Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Combobox examples · With States

With Disabled Items Combobox for React

A combobox where plans that aren't available yet are shown but can't be picked.

Framework
UI library

A service picker where two plans are listed but locked: Premium (Coming Soon) and Enterprise (Contact Sales). They're dimmed, skipped by the arrow keys and ignore clicks, while Basic and Standard work as usual. Use it to show what exists without letting people choose what they can't have yet.

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

Which items are disabled?

Premium (Coming Soon) and Enterprise (Contact Sales). Each service has a disabled flag in the data.

How is the flag passed to the combobox?

Each ComboboxItem gets disabled.

Where does the dimmed look come from?

ComboboxItem styles its disabled state with opacity-50 and turns off pointer events, so the demo adds no classes.

Can the keyboard reach a disabled row?

No. The arrow keys skip it and Enter can't select it.

How do I say why an item is off?

Put the reason in the label, as this demo does, or add a short description under it as in Items with Descriptions.