shadcn.io is an independent project built on shadcn/ui
Each heading is a button with a chevron. Engineering starts open, with Software, Hardware, and QA. Marketing starts closed, with Content, Social Media, and SEO. A click on the heading toggles its rows.
Use it for a long grouped list when people usually need one section. Short groups can stay open under a Combobox label. In React, Base UI does not collapse the groups. The headings do.
Installation
Anatomy

Usage
<Combobox items={departments}>
<ComboboxTrigger
render={
<Button className="w-[250px] justify-between" variant="outline" />
}
>
<ComboboxValue placeholder="Select department..." />
</ComboboxTrigger>
<ComboboxContent>
<ComboboxInput placeholder="Search..." showTrigger={false} />
<ComboboxEmpty>No department found.</ComboboxEmpty>
<ComboboxList>
{(group: Group) => (
<ComboboxGroup items={group.items} key={group.value}>
<ComboboxLabel>
<button
aria-expanded={!collapsed[group.value]}
className="flex w-full items-center gap-1"
data-group={group.value}
onClick={handleToggle}
type="button"
>
{collapsed[group.value] ? (
<ChevronRightIcon aria-hidden="true" className="size-3" />
) : (
<ChevronDownIcon aria-hidden="true" className="size-3" />
)}
{group.value}
</button>
</ComboboxLabel>
{collapsed[group.value] ? null : (
{/* The rest of the file is under Installation. */}FAQ
How is the collapsed state stored?
In a record of group names, which starts with Marketing collapsed. The heading button flips the entry for its group, read from a data-group attribute.
What is in each heading?
A button inside the group label with a ChevronRightIcon when closed or a ChevronDownIcon when open, then the group name. It sets aria-expanded to match.
Does the search find items in a closed group?
No. Only open groups are searched, the way the closed group's items are hidden. Open the group first, or expand every group while the search box has text.
API Reference
Combobox
Sets items={departments}, placeholder="Select department...", placeholder="Search...", showTrigger={false}, items={group.items} and value={item}. The rest is on the Combobox page.
Button
Sets variant="outline". The rest is on the Button page.





