shadcn.io is not affiliated with official shadcn/ui
Accordion examples · Subtitle
Accordion with Icons and Subtitle Text for React
An accordion of workspace sections where each trigger pairs a category icon with a title and a line of muted subtitle text.
An icon, a title and a muted subtitle on every trigger give each section a quick summary. This React accordion stacks the title over the subtitle beside the icon and keeps the built-in chevron on the right. Use it when the sections need a word of context, such as what kind of files they hold, before anyone opens them.
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.
How is the subtitle marked up?
The title and subtitle stack in flex flex-col items-start text-start beside the icon. The subtitle is text-sm text-muted-foreground. 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.
Why does Documents start open?
defaultValue={["documents"]} opens Documents on first render. The string matches that item's value.
Related
- Accordion with Subtitle TextA bordered accordion of help topics where
- Accordion with Icon, Subtitle, and ChevronAn accordion of workspace sections 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
- Card CollapsibleA card with a Features header that