Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Accordion
  3. API and Development

Accordion

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Accordion groups content into collapsible sections that users can expand or collapse on demand. It offers three visual variants and supports single or multiple expansion to organize content efficiently.
Props
Accordion
NameTypeDefaultDescription
childrenReactNode—Compose {@link AccordionItem } children.
classNamestring—Classes appended to the root.
collapsiblebooleantrueWhen false, the open item cannot collapse, so one item always stays open once opened. Not applicable when several sections may be open.
defaultValuestring | string[]—Initial open item value when uncontrolled. Initial list of open item values when uncontrolled.
initialItemIdstring—Item value whose trigger receives the tab stop on the first render, including server markup, when no section is open. An open section takes precedence. Without either, the first enabled trigger becomes the tab stop once the triggers mount.
onValueChangeAccordionValueChangeHandler—Fires when a trigger requests a change.
typeAccordionTypeAccordionType.SingleAllows one open section. Allows any number of open sections.
valuestring | string[]—Controlled open item value; an empty string means none is open. Controlled list of open item values.
variantAccordionVariantAccordionVariant.DefaultVisual chrome of every item.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
AccordionItem
NameTypeDefaultDescription
valuestringrequiredStable id for the item.
classNamestring—Custom classes.
childrenReactNoderequiredAccordionTrigger and AccordionContent.
AccordionTrigger
NameTypeDefaultDescription
classNamestring—Custom classes.
childrenReactNoderequiredHeader label and icons.
onClick() => void—Optional extra click handling.
AccordionContent
NameTypeDefaultDescription
classNamestring—Custom classes.
childrenReactNoderequiredExpanded body content.
Variants
Default
With the strongest visual structure, this variant offers clear separation with borders and background color.
Ghost
Use for a subtle look with minimal chrome on collapsed items—ideal for reducing visual weight while preserving hierarchy.
Line
Use for text‑forward layouts with simple dividers between item, particularly amidst dense, text‑heavy content.
All variants
Default expanded (single)
Default expanded (multiple)
Types
Single
Use when only one section should be open at a time. Great for FAQs, settings panels, and any context where focus should remain on a single area.
Multiple
Use when users may need to compare or reference several sections at once, such as forms and filters.
Previous
Accordion / Usage
Next
Accordion / Accessibility
On this page
Props
Accordion
Storybook
AccordionItem
AccordionTrigger
AccordionContent
Variants
Default
Ghost
Line
All variants
Default expanded (single)
Default expanded (multiple)
Types
Single
Multiple