Components
Accordion
A collapsible content component for showing and hiding sections
Demo
Code
Is it accessible?
Is it styled?
Installation
Usage
Basic Usage
Multiple Items Open
Allow multiple accordion items to be open at the same time:
Variants
The accordion supports multiple visual variants:
Disabled Items
Disable specific accordion items:
Default Open
Set a default open item:
Custom Content
Add any content inside the accordion:
API Reference
Accordion
The root component that wraps all accordion items.
| Prop | Type | Default | Description |
|---|---|---|---|
type | 'single' | 'multiple' | 'single' | Whether one or multiple items can be open |
value | string | string[] | — | Controlled value |
onValueChange | (value) => void | — | Callback when value changes |
collapsible | boolean | false | Allow closing all items (single mode) |
variant | 'default' | 'bordered' | 'separated' | 'filled' | 'ghost' | 'default' | Visual variant |
className | string | — | Additional classes |
AccordionItem
A single accordion item container.
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | Required | Unique identifier |
disabled | boolean | false | Whether item is disabled |
className | string | — | Additional classes |
AccordionTrigger
The clickable header that toggles the content.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | Trigger content |
className | string | — | Additional classes |
AccordionContent
The collapsible content section.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | Content to show/hide |
className | string | — | Additional classes |