shadcn.io is not affiliated with official shadcn/ui
Accordion examples · Tabs
Tab-Style Accordion for React
An accordion of account questions drawn as separate rounded cards with a gap between them, one open at a time.
Not every accordion has to be one connected block. This React accordion draws each account question as its own rounded card, with a gap between them and the built-in chevron on the right. Use it for FAQs and settings where each section should feel separate.
Preview
Installation
FAQ
How are the sections separated?
Accordion is flex flex-col gap-2, so each row has its own border. Each AccordionItem has rounded-lg border and px-4.
Which chevron is this?
AccordionTrigger is used with the title only, so it draws the built-in chevron on the right. This demo does not hide accordion-trigger-icon.
Why does the email question start open?
defaultValue={["email"]} opens the email question on first render. The string matches that item's value.
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 list every item that should start open in the defaultValue array.
Related
- Standard Accordion with ChevronA bordered accordion of three questions
- Tab-Style Accordion with Plus TriggerAn accordion of team questions drawn as
- Tab-Style Accordion with Left Plus TriggerAn accordion of integration questions
- Tab-Style Accordion with Left ChevronAn accordion of security questions drawn
- Card CollapsibleA card with a Features header that
- Accordion with Left ChevronA bordered accordion of shipping