Skip to content

Combobox

A select with icons, descriptions, groups, search and multiple choice - for when a native select is not enough.

On this page
Used for
  • Pick an assignee
  • Choose a model
  • Tag a ticket
  • Add reviewers
  • Search a long list

Examples

Installation

npx knowns-ui@latest add combobox
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

options
ComboboxOption[]
{ value, label, supportingText?, description?, keywords?, icon?, avatar?, dot?, disabled?, group? }. Same group → listed together under a header. keywords match the search without being shown.
option visuals
avatar: string | ReactNode · dot: true | tone · icon
One leading visual per row (avatar, then dot, then icon); the chosen one also shows in the trigger. A string avatar is an image URL.
supportingText / description
string
Muted text inline after the label (also searched), or a second line under it.
value / defaultValue / onValueChange
string | null - or string[] with multiple
Controlled or not. Single choice closes on pick; multiple stays open and toggles.
multiple + display
"summary" | "tags"
Default"summary"
Summary: first label and +N, Clear / Done footer. Tags: removable chips in the field with an inline search; Backspace removes the last.
searchable
boolean
Defaultfalse
Search field at the top filters by label and supporting text (case and accents ignored); result counts are announced politely.
size
"sm" | "md" | "lg"
Default"md"
28, 32 or 36px, the same scale as Input, Select and Button.
icon
ReactNode
Leading glyph in the trigger when the chosen option has no visual (or nothing is chosen).
placeholder / emptyText
string / ReactNode
Default"Select…" / "No results"
Trigger text with no value; text when nothing matches.
id / name
string
id goes on the focusable control so <Field id> labels it; name submits the value(s) as hidden inputs.
disabled / invalid
boolean
Defaultfalse
Invalid uses the field's red ring. Field's aria-describedby / aria-invalid / aria-required land on the control.
presentation
"popover" | "dialog" | "auto"
Default"popover"
Dialog: a modal (bottom sheet below 640px) with a search field and the same rows; multiple keeps a draft until Done, Escape / Cancel discard it. Auto: dialog below 640px or on touch.
dialogTitle / dialogDescription
ReactNode
Defaultaria-label / label
Heading and description of the dialog presentation.
aria-label
string
Needed only without a Field / <label for>. Keys: ↓ Enter Space open, ↑ opens at the end, ↑↓ PageUp PageDown move, Enter picks, Escape closes.

What it handles

  1. 01Opens a listbox under the field with options that carry an icon, an avatar, a status dot, supporting text, a description and a group header.
  2. 02Filters as you type in a search field by label, supporting text and hidden keywords, ignoring case and accents.
  3. 03Runs in single mode, or in multiple mode with a summary trigger showing the first label and a count and Clear and Done in the footer, or display tags with removable chips and Backspace to remove the last.
  4. 04Moves with the arrows, Home, End, PageUp and PageDown, picks with Enter, and closes with Escape, with aria-activedescendant following the active option.
  5. 05Presents as a popover, as a modal Dialog with a search field, or auto, which picks the dialog below 640px or on touch.
  6. 06Submits one hidden input per selected value when name is set, and shows emptyText, default No results, when nothing matches.

States

First render
Nothing. The trigger shows the chosen value or the placeholder
none
Popover open
The list fades in under the field
120ms, opacity only
Active option
The highlight is placed on the row at once and does not glide
none, at once
Dialog open
The dialog shows with a search field; multiple choices wait for Done
none
Footer buttons
Clear and Done change colour on hover
120ms, ease out
Reduced motion
The popover appears at once
0ms

Works with

When to use

When to use

  • Picking one or many values from a long list with search, icons, avatars or groups.

When not to use

  • A few plain options: use Select.
  • Choosing a model with price and context details: use Model Picker.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Combobox to my app and wire it to my own data.
  • I need picking one or many values from a long list with search, icons, avatars or groups. Set that up with the Knowns UI Combobox.
  • Which Combobox props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "combobox" }) and search_docs({ query: "combobox" }).

Need help?

Stuck on Combobox, or found something off? We read every message.