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
idString—Optional component ID
tabsList<Tab>—Tab definitions
orientationOrientation—horizontal (default) or vertical
variantTabLayoutVariant—Visual style variant
styleString—Inline CSS
cssClassesString—CSS class names
PropertyTypeDefaultDescription
labelString—Tab header label
contentComponent—Tab body content
iconOnLeftString—Icon name rendered before the label
iconOnRightString—Icon 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()