Logo

ExpandableItem

ExpandableItem creates expandable/collapsible section, similar to the HTML details disclosure element. When the user clicks on the summary the content expands or collapses.

Properties

enabled (default: true)

When true, the expandable item can be opened and closed. When false, it cannot be toggled.

iconCollapsed (default: "chevronright")

The icon to display when the item is collapsed.

iconExpanded (default: "chevrondown")

The icon to display when the item is expanded.

iconPosition (default: "end")

Determines the position of the icon (start or end).
Available values:
ValueDescription
startThe icon will appear at the start (left side when the left-to-right direction is set)
endThe icon will appear at the end (right side when the left-to-right direction is set) (default)

initiallyExpanded (default: false)

Determines if the component is initially expanded when rendered.

summary

The summary content that is always visible and acts as the trigger.

withSwitch (default: false)

When true, a switch is used instead of an icon to toggle the expanded state.

Events

expandedChange

This event fires when the expandable item is expanded or collapsed. It provides a boolean value indicating the new state.

Exposed Methods

collapse

This method collapses the item.
Signature: collapse(): void

expand

This method expands the item.
Signature: expand(): void

isExpanded

This method returns a boolean indicating whether the item is currently expanded.
Signature: isExpanded(): boolean

toggle

This method toggles the item's expanded state.
Signature: toggle(): void

Styling

Theme Variables

VariableDefault Value (Light)Default Value (Dark)
backgroundColor-ExpandableItemtransparenttransparent
border-ExpandableItemnonenone
borderBottom-ExpandableItemnonenone
borderBottomColor-ExpandableItemnonenone
borderBottomStyle-ExpandableItemnonenone
borderBottomWidth-ExpandableItem1px1px
borderColor-ExpandableItem$borderColor$borderColor
borderEndEndRadius-ExpandableItemnonenone
borderEndStartRadius-ExpandableItemnonenone
borderHorizontal-ExpandableItemnonenone
borderHorizontalColor-ExpandableItemnonenone
borderHorizontalStyle-ExpandableItemnonenone
borderHorizontalWidth-ExpandableItemnonenone
borderLeft-ExpandableItemnonenone
color-ExpandableItemnonenone
borderLeftStyle-ExpandableItemnonenone
borderLeftWidth-ExpandableItemnonenone
borderRadius-ExpandableItem00
borderRight-ExpandableItemnonenone
color-ExpandableItemnonenone
borderRightStyle-ExpandableItemnonenone
borderRightWidth-ExpandableItemnonenone
borderStartEndRadius-ExpandableItemnonenone
borderStartStartRadius-ExpandableItemnonenone
borderStyle-ExpandableItemsolidsolid
borderTop-ExpandableItemnonenone
borderTopColor-ExpandableItemnonenone
borderTopStyle-ExpandableItemnonenone
borderTopWidth-ExpandableItemnonenone
borderHorizontal-ExpandableItemnonenone
borderVerticalColor-ExpandableItemnonenone
borderVerticalStyle-ExpandableItemnonenone
borderVerticalWidth-ExpandableItemnonenone
borderWidth-ExpandableItem00
color-ExpandableItem$textColor-primary$textColor-primary
color-ExpandableItem--disabled$textColor--disabled$textColor--disabled
fontFamily-ExpandableItem$fontFamily$fontFamily
fontSize-ExpandableItemnonenone
fontWeight-ExpandableItemnonenone
gap-ExpandableItem$space-2$space-2
padding-content-ExpandableItemnonenone
padding-ExpandableItemnonenone
paddingBottom-content-ExpandableItemnonenone
paddingBottom-ExpandableItem$space-2$space-2
paddingHorizontal-content-ExpandableItemnonenone
paddingHorizontal-ExpandableItemnonenone
paddingHorizontal-ExpandableItem-summarynonenone
paddingLeft-content-ExpandableItem$space-3$space-3
paddingLeft-ExpandableItem$space-0$space-0
paddingRight-content-ExpandableItem$space-3$space-3
paddingRight-ExpandableItem$space-0$space-0
paddingTop-content-ExpandableItemnonenone
paddingTop-ExpandableItem$space-2$space-2
paddingVertical-content-ExpandableItem$space-2$space-2
paddingVertical-ExpandableItemnonenone
paddingVertical-ExpandableItem-summarynonenone
transition-ExpandableItem0.2s ease0.2s ease
This site is an XMLUI™ app.