shadcn.io is not affiliated with official shadcn/ui
Accordion examples · Standard
Standard Accordion with Chevron for React
A bordered accordion of three questions, one open at a time, with the built-in chevron on the right of each trigger.
Sometimes you just need a clean accordion without the extras. This React accordion stacks three questions in bordered rows, with the chevron that AccordionTrigger draws on the right and the first answer open. On Base UI, opening one item closes the other, which suits FAQs, settings panels and help sections where one answer at a time is enough.
Preview
Installation
FAQ
When should I use a standard accordion vs other variants?
Use it when the headings explain themselves and the content is a paragraph or two: an FAQ, a settings group, a help section. Reach for icons or subtitles when people need more to go on before they open an item, and for a nested layout when sections hold sub-topics.
How do I let several items stay open at once?
One open item is the default. Add multiple to Accordion to let several stay open, and pass every item to open first in the defaultValue array.
How do I customize the border and spacing?
Each AccordionItem gets a full border, and -space-y-px on Accordion pulls the items up by one pixel so neighboring borders overlap into a single line. first:rounded-t-lg and last:rounded-b-lg round the outer corners. Change px-4 on the items for more room, or drop the borders for a flat list.
Can I change the chevron icon?
AccordionTrigger draws its own chevron, a down arrow that turns into an up arrow when the item opens. Both icons have data-slot="accordion-trigger-icon", so **:data-[slot=accordion-trigger-icon]:hidden on a trigger hides them and you can put your own icon in the trigger. To change the icon everywhere, edit it in components/ui/accordion.
Related
- Accordion with Left ChevronA bordered accordion of shipping
- Accordion with Plus/Minus ToggleA bordered accordion of billing questions
- Accordion with Subtitle TextA bordered accordion of help topics where
- Multi-Level Nested AccordionAn accordion of help center topics where
- Accordion Form with Icon SectionsA form split into personal, contact and
- Card CollapsibleA card with a Features header that