shadcn.io is not affiliated with official shadcn/ui
Accordion examples · Subtitle
Accordion with Icon, Subtitle, and Chevron for React
An accordion of workspace sections where each trigger has a category icon, a title over a short subtitle, and the chevron on the right.
Each row here says three things before it opens: an icon for the kind of content, a title, and a muted subtitle that lists what the section holds. This React accordion keeps the chevron that AccordionTrigger draws on the right, and the Documents section starts open. Use it for dashboards and settings where people pick a section by more than its name.
Preview
Installation
FAQ
Where do the category icons come from?
Each item stores FileTextIcon, FolderIcon, SettingsIcon or UsersIcon. The trigger renders it at size-4 with text-muted-foreground, shrink-0 and aria-hidden, in a gap-3 row before the text.
Where is the chevron?
AccordionTrigger draws its own chevron on the right. This trigger does not hide accordion-trigger-icon, and hover:no-underline is set on the trigger.
How is the subtitle marked up?
Title and subtitle stack in flex flex-col items-start text-start. The subtitle is text-sm text-muted-foreground.
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 Subtitle TextAn accordion of workspace sections where
- Accordion with Subtitle TextA bordered accordion of help topics where
- Accordion with Category IconsAn accordion of workspace sections, each
- Accordion with Subtitle and Plus/Minus ToggleA bordered accordion of help topics where
- Multi-Level Accordion with IconsAn accordion of workspace sections with a
- FAQ with Icon CollapsibleAn FAQ question in a bordered box, led by