Skip to content

AccordionLayout

Groups content into collapsible panels. Only one (or none) panel is open at a time by default.

AccordionLayout.builder()
.panels(List.of(
AccordionPanel.builder()
.label("Section 1")
.content(new Text("Content for section 1"))
.build(),
AccordionPanel.builder()
.label("Section 2")
.content(new Text("Content for section 2"))
.active(true)
.build()
))
.build()
PropertyTypeDefaultDescription
idString—Optional component ID
panelsList<AccordionPanel>—List of collapsible panels
variantAccordionLayoutVariant—Visual style variant
styleString—Inline CSS
cssClassesString—CSS class names
PropertyTypeDefaultDescription
labelString—Panel header / toggle trigger (plain text; ${...} expressions are interpolated)
contentComponent—Collapsible panel body
activebooleanfalseWhether this panel is initially expanded
disabledbooleanfalseShows the panel but does not let it open
style / cssClassesString—Inline CSS / class names of the panel

The header is a text label; anything richer goes in the panel’s content:

AccordionLayout.builder()
.panels(List.of(
AccordionPanel.builder()
.label("Personal data")
.content(personalDataForm)
.active(true)
.build(),
new AccordionPanel("Address", addressForm)
))
.build()

See it live in the Explorer: Tabs, accordions & carousel