Accordion

A vertically stacked set of collapsible items with animated expand/collapse transitions and support for single or multi-item expansion.

Accordion renders a vertical list of AccordionItemData entries. Each item has a tappable header with a rotating chevron and an animated content panel that fades and expands into view. By default multiple items can be open simultaneously; set singleItemExpand = true to allow only one open item at a time.

Basic usage

API reference

Accordion

ParameterTypeDefaultDescription
itemsList<AccordionItemData>Ordered list of sections to render.
modifierModifierModifierApplied to the root Column container.
defaultOpenItemIdString?nullID of the item to expand on first composition.
singleItemExpandBooleanfalseWhen true, opening an item collapses any currently open item.

AccordionItemData

FieldTypeDescription
idStringUnique identifier used to track expanded state.
header@Composable () -> UnitContent rendered inside the tappable header row.
content@Composable () -> UnitContent revealed when the item is expanded.
Edit this page on GitHub