Skip to content

Accordion

Accordion and AccordionItem are built on React Aria’s DisclosureGroup and Disclosure primitives. Each item has a trigger button and a collapsible panel.

Terminal window
npx @a2ra/cli add accordion
{
"type": "Accordion",
"children": [
{
"type": "AccordionItem",
"props": { "id": "q1", "heading": "What is A2UI?" },
"children": "A2UI is a JSON schema for describing UI components."
}
]
}
PropTypeDescription
allowsMultipleExpandedtrue
false default
When true, multiple items can be open at once
isDisabledtrue
false default
Disables all items in the group
childrennode[]One or more AccordionItem nodes
PropTypeDescription
headingstringTrigger button label (required)
idstringStable identifier for the disclosure
defaultExpandedtrue
false default
Whether the item starts open
isDisabledtrue
false default
Disables this item’s trigger
childrenstring
node[]
Panel content
  • heading is required on every AccordionItem; it becomes the accessible trigger button label.
  • By default only one item can be open at a time. Opening a new item automatically closes the previous one.
  • The chevron rotates 180° when the panel is expanded via a CSS transition on [data-expanded].