Accordion
Expand or collapse related content sections.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/accordionComplete the one-time setup first. Registry JSON lists source files and dependencies.
For this page’s examples, also install:
pnpm dlx shadcn@4.18.0 add @siteplane/buttonUsage
import {
Accordion,
AccordionItem,
AccordionTrigger,
AccordionPanel,
} from "@/siteplane/components/accordion";
<Accordion>
<AccordionItem value="one">
<AccordionTrigger>Details</AccordionTrigger>
<AccordionPanel>Content</AccordionPanel>
</AccordionItem>
</Accordion>;Composition
Accordion
└── AccordionItem
├── AccordionTrigger (includes Header)
└── AccordionPanel / AccordionContentMultiple panels
Set multiple to let more than one item stay open. The value is always an array of the open items.
Disabled items
Set disabled on an AccordionItem to keep it visible while preventing it from opening.
Controlled state
Use value and onValueChange together when other parts of the interface open or close items. Here, a button opens every item.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
value / default | value[] | foundation empty selection | Controlled or initial open items. |
on | (values, eventDetails) => void | unset | Expansion callback. |
multiple | boolean | false | Allows simultaneous expansion. |
Accordion | unknown | unset | Use stable values for controlled items. |
Accordion | boolean | false | Disables the item. |
Accordion | ReactElement | render function | text Button, full width | Composed trigger; supplies header, label wrapper and chevron. |
Accordion | string | unset | Extra panel classes, merged with the panel motion classes. |
Accordion, AccordionItem, AccordionTrigger and AccordionPanel wrap the
corresponding Base UI
Accordion parts.
AccordionContent aliases AccordionPanel; AccordionPrimitive is the
foundation namespace. No other owned props are added. Every part takes a string
className; style a state through the part's data attributes. Panel wraps
children in a div and animates foundation panel height. keepMounted and refs
remain foundation contracts. Base UI deprecates its orientation and
loopFocus props; they no longer change keyboard focus.
Usage notes
Enter or Space toggles a focused trigger, and Tab moves between the triggers; arrow keys do not move focus. Avoid putting another interactive control inside the trigger. Use Collapsible for one disclosure rather than a related list.