Skip to content

TabLayout

Organises content into switchable tabs.

TabLayout.builder()
.tabs(List.of(
Tab.builder()
.label("General")
.content(generalContent)
.build(),
Tab.builder()
.label("Settings")
.content(settingsContent)
.build()
))
.build()
PropertyTypeDefaultDescription
idStringOptional component ID
tabsList<Tab>Tab definitions
orientationOrientationhorizontal (default) or vertical
variantTabLayoutVariantVisual style variant
styleStringInline CSS
cssClassesStringCSS class names
PropertyTypeDefaultDescription
labelStringTab header label
contentComponentTab body content
iconOnLeftStringIcon name rendered before the label
iconOnRightStringIcon name rendered after the label
selectedbooleanfalseWhether this tab is initially selected
TabLayout.builder()
.orientation(Orientation.vertical)
.tabs(List.of(
Tab.builder().label("Profile").content(profileForm).build(),
Tab.builder().label("Security").content(securityForm).build()
))
.build()
TabLayout.builder()
.tabs(List.of(
Tab.builder()
.label("Orders")
.iconOnLeft(IconKey.Cart.iconName)
.content(ordersGrid)
.selected(true)
.build(),
Tab.builder()
.label("Invoices")
.iconOnLeft(IconKey.Document.iconName)
.content(invoicesGrid)
.build()
))
.build()