Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Combobox examples · Standard

With Item Icons Combobox for React

A combobox with an icon beside each platform, repeated on the button once one is picked.

Framework
UI library

A platform picker with an icon on every row: a globe for Web, a phone for Mobile and the GitHub mark for GitHub. The chosen platform's icon and name then show on the button. Use it for platform, tool or integration pickers, where an icon is recognized faster than a word.

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

Where do the icons live?

Each platform keeps its icon component next to its label and value, and the row renders it before the label at size-4. The GitHub mark is a small SVG component, since the icon set has no brand logos.

How does the button show the same icon?

It renders the selected platform's icon and label side by side, and Select platform... when nothing is picked. ComboboxValue takes a function that gets the selected platform.

Are the icons announced?

No. They have aria-hidden, since the label next to them already says the same thing.

How is the selected platform marked?

ComboboxItem adds its check at the end of the row, after the icon and the label.

Can I use other icons?

Yes. Any icon component works, from Lucide or your own SVG. Keep them the same size so the labels line up.