Components/Accordion
Accordion
Collapsible content sections with smooth height animations. Supports single and multiple open modes with full keyboard navigation.
import { Accordion, AccordionItem } from "@animui/ui"Basic
Multiple open
Set multiple to allow more than one item open at once.
Accordion Props
| Prop | Type | Default | Description |
|---|---|---|---|
multiple | boolean | false | When true, multiple items can be open simultaneously. |
defaultValue | string | — | The value of the item that should be open by default. |
children | React.ReactNode | — | AccordionItem children. |
className | string | — | Additional classes for the wrapper. |
AccordionItem Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Unique identifier for this item. Required. |
title | string | React.ReactNode | — | The trigger label shown in the header. |
children | React.ReactNode | — | Content revealed when the item is open. |
className | string | — | Additional classes for this item's wrapper. |
Accessibility
- ✓Each trigger is a
<button>witharia-expanded. - ✓Content panels have
role="region"and are linked to their trigger. - ✓
Space/Entertoggle the focused item.