Components
Collapsible Container
The Collapsible Container Component.
The collapsible container component allows you to create a collapsible section that can be expanded or collapsed. It supports a title text and various sizing and alignment options.
Parameters
expanded
boolean
Whether the collapsible container is initially expanded or not.
text
string
The title text of the collapsible container.
padding
int | (int,int,int,int)
The padding around the child components.
surface
#hex
The background surface of the collapsible container.
horizontal-alignment
left | right | center
The horizontal alignment of the child components.
vertical-alignment
top | middle | bottom
The vertical alignment of the child components.
allow-overflow
boolean
Whether to allow the dropdown entries to overflow the bounds of the collapsible container.
Examples
Containers.collapsible(Text.literal("Collapsible Section"), true)
.child(Components.label(Text.literal("Content")))
.padding(Insets.of(10))
.surface(Surface.PANEL)
.horizontalAlignment(HorizontalAlignment.CENTER)
.verticalAlignment(VerticalAlignment.CENTER)
<collapsible expanded="true">
<text>Collapsible Section</text>
<children>
<label>
<text>Content</text>
</label>
</children>
<padding>
<all>10</all>
</padding>
<surface>
<panel/>
</surface>
<horizontal-alignment>center</horizontal-alignment>
<vertical-alignment>center</vertical-alignment>
</collapsible>