Accordion
Collapsible content sections with ARIA accordion semantics.
npx @slipstream-ui/cli@latest add accordionFull-width usage
An AI-first component system with machine-readable manifests.
Custom header icon
The icon prop replaces the default chevron; the rotate-on-open behavior is yours to define when you bring your own markup.
Borderless + gap
variant="borderless" removes the outer border and dividers; gap accepts tokens ('lg') or exact pixels (16).
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string[] | — | Controlled open item ids. |
| collapsible | boolean | true | When true, opening an item closes the others. |
| onValueChange | (value: string[]) => void | — | Called when the open set changes. |
| variant | 'default' | 'borderless' | 'default' | Bordered card with dividers, or plain stacked sections. |
| gap | 'none' | 'sm' | 'md' | 'lg' | 'xl' | number | — | Token gap ('lg') or exact pixels (16) between items. |
| items | AccordionSection[] | — | Declarative sections ({ id, title, content, disabled }); one AccordionItem is rendered per entry instead of children. |
| AccordionTrigger icon | ReactNode | — | Swap the default chevron rendered at the far right of the header. |
Accessibility
- Trigger has aria-expanded and aria-controls; panel has role=region.
- Hidden panels are removed from the tab order.
- The header is clickable edge-to-edge (w-full) in closed and open states; icon is pinned far right.
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+ — macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA — the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.
- Expansion animates via grid-template-rows interpolation (Chrome/Edge 117+, Safari 17+, recent Firefox). Older browsers toggle panels instantly — no functionality lost.
- prefers-reduced-motion: reduce disables the animation.