shadcn.io is not affiliated with official shadcn/ui
Collapsible examples · Sidebar
Settings Menu Collapsible for React
A Preferences menu with a settings icon that expands to Profile, Notifications and Privacy links.
A settings section that opens to its pages. The Preferences trigger pairs a settings icon with its label and a chevron, and the content, on a muted background, lists Profile, Notifications and Privacy with their icons. Use it in account menus and settings sidebars.
Preview
Installation
FAQ
What is in the Preferences trigger?
A settings icon and the label at the start, and a chevron at the end, in a justify-between row that tints on hover. The trigger has the group class and sets aria-expanded while open, so group-aria-expanded:rotate-180 on ChevronDownIcon turns it, eased by transition-transform duration-200.
How is the opened list styled?
CollapsibleContent has border-t bg-muted/50, and the links sit in a nav with flex flex-col gap-1 p-2. Each link turns to the background color on hover, so it lifts off the muted panel.
Related
- Nested Sidebar Items CollapsibleA two-level sidebar tree where
- Sidebar with Counts CollapsibleAn Inbox sidebar item with a count badge
- Card with Icon Header CollapsibleA card whose header has an icon tile, a
- Minimal Sidebar Group CollapsibleA sidebar group with a small uppercase
- Accordion with Category IconsAn accordion of workspace sections, each
- FAQ with Icon CollapsibleAn FAQ question in a bordered box, led by