Accordion

An accordion that supports single or multiple expansion, optional per-item icons, controlled and uncontrolled modes, grid-based height animation and the WAI-ARIA accordion pattern.

Props

PropTypeDefaultDescription
type'single' | 'multiple''single'Expansion mode: single (one item at a time) or multiple (several at once)
valuestring | string[]—Controlled expanded value; a string[] when multiple
defaultValuestring | string[]—Initial value when uncontrolled; a string[] when multiple
onValueChange(value: string | string[]) => void—Called on every change; the signature follows type (string / string[])
collapsiblebooleanfalseAllows clicking the open item again to collapse it (multiple is always collapsible)
variant'lined' | 'separated''lined'Appearance: lined (stacked with dividers) or separated (standalone cards)
Accordion.Item{ value: string; disabled?: boolean } & HTMLAttributes—A single item; its value links the trigger and the panel, and it can be disabled
Accordion.Trigger{ icon?: ReactNode } & ButtonHTMLAttributes—The heading button, wrapped in an h3; icon renders a leading icon
Accordion.ContentHTMLAttributes—Panel kept in the DOM, only hidden while collapsed
...restHTMLAttributes—Remaining props are forwarded to the native div