Draft. Ported from the shadcn-vue registry on 12 November 2026. Not yet approved. It is in the registry so teams can try it; the API may still change before approval.
A combobox is a field people type into to narrow a list, then choose an option from it.
When to use
- For a long list people search by name, such as warehouses, customers or products.
- When people know what they are looking for and typing a few letters is quicker than scrolling.
When not to use
- For a short list people scan. Use a Select.
- For free text with suggestions that people may also type freely. Use an input with suggestions, and accept any value.
- To start actions or search the whole app. Use a command menu.
Content
- Always give it a visible label. The placeholder says what to type: “Search warehouses…”.
- Write the “no results” line as a fact and, when you can, a way out: “No warehouse found.”
- Options show the name people search by. Put extra details after it, not before.
- Group long lists with headings, such as “Online stores” and “Marketplaces”.
Behaviour
- Typing opens the list and keeps only matching options. Matches are found anywhere in the option text.
- The chosen option has a check mark and a selected fill. Choosing closes the list and puts the option’s name in the field.
- The list is as wide as its anchor, 4 px away, and moves above when there is no room.
- Values are objects with a key (
by="id") or strings; never the empty string.
Tokens
| Part | Tokens |
|---|---|
| Field | An Input group: size.control.default, radius.control, color.border.bold edge on color.surface, search icon color.icon.subtle, placeholder color.text.subtlest |
| Focus | Edge color.border.focus with a 2 px inset ring of the same colour inside it |
| List | color.surface.overlay (no border), radius.overlay, elevation.shadow.overlay, z-index.overlay, padding space.overlay, offset space.overlay.offset |
| Option | size.control.default, radius.item, space.item.x, font.label.default; highlight color.surface.overlay.hover; chosen color.surface.overlay.selected and a color.icon check |
| Group heading, “no results” | font.heading.xsmall and font.body.default in color.text.subtle |
Related
- Select: a short list without search.
- Tags input: several free values.