Accordion
Stacked collapsible sections with an interruptible spring height, a blur fade on the content, and single or multiple open items.
Customize
Installation
npx shadcn@latest add @kinetic/accordionUsage
Compose Accordion, AccordionItem, AccordionTrigger and AccordionContent. Each item needs a unique value.
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/kinetic/ui/accordion";
export function Faq() {
return (
<Accordion type="single" defaultValue="shipping" collapsible>
<AccordionItem value="shipping">
<AccordionTrigger>How long does shipping take?</AccordionTrigger>
<AccordionContent>Orders ship within two business days.</AccordionContent>
</AccordionItem>
<AccordionItem value="returns">
<AccordionTrigger>Can I return an item?</AccordionTrigger>
<AccordionContent>Returns are free for 30 days.</AccordionContent>
</AccordionItem>
</Accordion>
);
}Multiple
Set type="multiple" to let several items stay open. value and defaultValue then take an array of keys.
<Accordion type="multiple" defaultValue={["shipping", "returns"]}>...</Accordion>Collapsible
In single mode, collapsible (on by default) lets the open item close again. Set it to false to keep one item open at all times.
<Accordion type="single" defaultValue="shipping" collapsible={false}>...</Accordion>Icon
Choose the indicator with icon: a rotating chevron or a plus that morphs into a minus.
<Accordion type="single" icon="plus">...</Accordion>Keyboard
Triggers are buttons inside headings. ArrowUp and ArrowDown move between triggers, Home and End jump to the first and last.
Motion preferences
Toggling mid-animation reverses from the current height. Use blurPx and speed to tune the reveal. Reduced motion opens and closes instantly.
API Reference
Accordion
Zero-dependency accordion provider managing single or multiple expanded items, spring speed, content blur, and icon style.
| Prop | Type | Default | Description |
|---|---|---|---|
type | "single" | "multiple" | "single" | Allows either one item or multiple items open at once. |
value / defaultValue / onValueChange | string | readonly string[] | - | Controlled or initial expanded item key(s). |
collapsible | boolean | true | Allows closing the currently open item in single mode. |
icon | "chevron" | "plus" | "chevron" | Selects rotating chevron or morphing plus-to-minus indicator. |
blurPx / speed | number | 4 / 1 | Content blur radius (px) and spring speed multiplier (0.25-4). |