shadcn.io is not affiliated with official shadcn/ui
Accordion examples · Standard
Full Featured Accordion for React
An accordion of workspace sections where each trigger has a category icon, a title over a short subtitle, and a plus/minus toggle.
Everything at once: a category icon, a title over a muted subtitle, and a plus/minus toggle on every trigger. This React accordion hides the built-in chevron and draws the toggle on the right, so each row says what it holds, what is inside, and that it opens. Use it for dense dashboards and workspace navigation.
Preview
Installation
FAQ
What is inside each trigger?
A gap-3 row holds the category icon and a stack of the title over the subtitle. justify-between pushes the plus and minus to the end. The icon is FileTextIcon, FolderIcon, SettingsIcon or UsersIcon, at size-4 with aria-hidden.
How does the plus turn into a minus?
**:data-[slot=accordion-trigger-icon]:hidden on AccordionTrigger hides the built-in chevron. PlusIcon and MinusIcon share one relative size-4 box, and group-aria-expanded/accordion-trigger fades the plus out and the minus in over duration-200. Both icons are aria-hidden and text-muted-foreground.
How is the subtitle marked up?
The subtitle is text-sm text-muted-foreground under the title, in flex flex-col items-start text-start. Documents uses Contracts, invoices and briefs.
Why is the answer indented?
ps-7 on AccordionContent matches the 16px icon plus the 12px gap-3, so the answer lines up under the title.
Related
- Accordion with Icons and Plus/Minus ToggleAn accordion of workspace sections with a
- Accordion with Subtitle TextA bordered accordion of help topics where
- Accordion with Category IconsAn accordion of workspace sections, each
- Accordion Form with Icon SectionsA form split into personal, contact and
- Multi-Level Accordion with IconsAn accordion of workspace sections with a
- Standard Accordion with ChevronA bordered accordion of three questions