Accordion
Accordion organizes several short, scannable disclosure panels that can open independently or as a controlled group.
Purpose
Accordion organizes several short, scannable disclosure panels. Use it for FAQs, compact settings, or supporting information that does not need to remain visible. Use Collapsible when there is only one panel.
Basic usage
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/accordionImport
import { Accordion, AccordionContent, AccordionItem, AccordionPanel, AccordionTrigger } from "@/components/ui/accordion";Need the machine-readable source metadata? View registry JSON.
Usage
Use Accordion for related disclosure panels. Keep the trigger text specific and the panel content concise.
import { Accordion, AccordionItem, AccordionPanel, AccordionTrigger } from "@/components/ui/accordion";
export function Example() {
return (
<Accordion defaultValue={["security"]}>
<AccordionItem value="security">
<AccordionTrigger>Security settings</AccordionTrigger>
<AccordionPanel>Two-factor and session controls.</AccordionPanel>
</AccordionItem>
</Accordion>
);
}Examples
Multiple open panels, controlled state and disabled items are props of the same primitive. value and defaultValue always take an array of item values.
Multiple open
Controlled
Disabled item
disabled sits on the item. The trigger keeps its layout and shows the not-allowed state.
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
AccordionItemowns a value and may be disabled independently.defaultValue,value, andonValueChangeuse arrays, including single-open accordions. Addmultipleonly when several panels may remain open.AccordionContentis a compatibility alias forAccordionPanel; new code usesAccordionPanel.- Keep
AccordionTriggerandAccordionPanelinside the matchingAccordionItem.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
AccordionPanelanimates height through--accordion-panel-heightand the shared expand duration and easing tokens.- Chevron rotation, trigger hover and press states, and reduced-motion behavior are built into the primitive. System and provider reduced-motion modes remove transition interpolation. Do not recreate them in feature code.
Accessibility
AccordionTriggerrenders a button and keeps Base UI keyboard, focus, and expanded-state semantics.- Set disabled state on
AccordionItemso its trigger, panel, and state remain synchronized. - Allow multiple open panels only when comparing their content is useful.
- Do not hide critical decisions, long forms, or primary workflows in an accordion.
Implementation Guidance
- Use Accordion for a related group of disclosures and Collapsible for one disclosure.
- Preserve the primitive indicator, panel, focus, disabled, and motion classes.
- Use the canonical
AccordionPanelname in new code.