Components
Accordion
Collapsible sections for FAQs, settings panels, and progressive disclosure patterns.
Import
Usage
Multiple open
Controlled
Default open
Accordion Props
| Prop | Type | Default | Description |
|---|---|---|---|
type | 'single' | 'multiple' | 'single' | Allow one or multiple open items |
defaultValue | string | — | Initially open item (uncontrolled, single) |
value | string | string[] | — | Open item(s) (controlled) |
onValueChange | (v: string | string[]) => void | — | Called when open state changes |
collapsible | boolean | true | Allow closing by clicking open item |
className | string | — | Additional CSS classes |
AccordionItem Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | React.ReactNode | — | Trigger label |
value | string | — | Unique identifier |
disabled | boolean | false | Disable this item |
children | React.ReactNode | — | Panel content |
className | string | — | Additional CSS classes |
Accessibility
- Trigger has
role="button"witharia-expandedandaria-controls - Panel has
role="region"witharia-labelledbypointing to the trigger - Enter/Space toggles the panel
- Disabled items have
aria-disabled="true" - Animated with CSS transitions that respect
prefers-reduced-motion