Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Combobox examples · Grouped

Categories with Separators Combobox for React

A combobox whose pages are split into three unlabeled sections by separators.

Framework
UI library

A page picker in three sections with a thin rule between them: Home and Dashboard, then Settings and Profile, then Help and Logout. The sections have no headings, so the rules alone do the grouping. Use it for short lists with an obvious split, such as navigation, where a heading per section would be noise.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

How are the sections built?

Each section is a ComboboxGroup and a ComboboxSeparator sits between two groups. The data is a list of groups, each with its own items.

Why don't the groups show a heading?

The original layout has none, so the groups only get an aria-label (Primary, Secondary, Other) that screen readers announce. Add a group label when the sections need a name on screen, as in Multiple Groups with Labels.

What can I pick?

Home, Dashboard, Settings, Profile, Help and Logout. The search box says Search..., and No page found. shows when nothing matches.

What does the button show?

Select page... until a page is picked, then its label.

Do the arrow keys cross the separators?

Yes. They move through every item in order and skip the separators, which can't be focused.