Accordion
Progressively reveal supporting information in place.
npx shadcn@latest add @silicon-ui/accordionInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/accordionManually
Install the dependencies
npm install @radix-ui/react-accordion lucide-react motionCopy these files into your project
- components/silicon-ui/accordion/accordion.tsx
- components/silicon-ui/accordion/accordion.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
items* | AccordionItem[] | — |
defaultOpen | number | 0 |
size"lg" suits page-level FAQs: questions at the large text size, answers at body size. | "md" | "lg" | "md" |