shadcn.io is not affiliated with official shadcn/ui
Accordion examples · Subtitle
Accordion with Subtitle Text for React
A bordered accordion of help topics where each trigger shows a title over a muted subtitle, with the chevron on the right.
A line of muted text under each title tells readers what is inside before they open it. This React accordion stacks a title and a subtitle in each trigger and keeps the built-in chevron on the right. Use it for help topics, documentation sections and settings groups.
Preview
Installation
FAQ
How is the subtitle marked up?
Each item stores a subtitle string under its title. The trigger puts them in a flex flex-col items-start text-start stack, and the subtitle is text-sm text-muted-foreground.
Why does the trigger set hover:no-underline?
hover:no-underline is on AccordionTrigger, so hovering the two-line heading does not underline it. The built-in chevron stays, because this trigger leaves accordion-trigger-icon visible.
Why does Getting started start open?
defaultValue={["getting-started"]} opens Getting started 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
- Accordion with Icons and Subtitle TextAn accordion of workspace sections where
- Accordion with Subtitle and Plus/Minus ToggleA bordered accordion of help topics where
- Accordion with Icon, Subtitle, and ChevronAn accordion of workspace sections where
- FAQ Item CollapsibleAn FAQ question with a plus that turns
- Multi-Level Nested AccordionAn accordion of help center topics where