1. Documentation
  2. Forms
  3. Combobox
ReadmenpmGitHub
  • Introduction
  • Installation
  • Theming
  • Icons
  • Accordion
  • Card
  • Scroll Area
  • Separator
  • Sidebar
  • Field
  • Label
  • Input
  • Textarea
  • Number Field
  • OTP Field
  • Select
  • Combobox
  • Checkbox
  • Radio
  • Switch
  • Slider
  • Toggle
  • Calendar
  • Date Picker
  • File Upload
  • Button
  • Copy Button
  • Dropdown
  • Command
  • Tabs
  • Breadcrumb
  • Pagination
  • Tree
  • Table
  • Data Table
  • Stat
  • Timeline
  • Avatar
  • Status Bar
  • Badge
  • Meter
  • Empty
  • Skeleton
  • Spinner
  • Toast
  • Dialog
  • Sheet
  • Popover
  • Tooltip
  • Text
  • Kbd
  • Code Block
  • Utilities
  • Design rules

Combobox

A Select you can type into — single or multiple, with chips that keep their place.

Loading documentation…

Select< PreviousCheckboxNext >

Powered by heyo

On this page

UsageMultipleGroups, icons and descriptionsEmpty stateProperties
<Comboboxplaceholder="Pick a region"options={[  { value: "fra", label: "Frankfurt", description: "eu-central", group: "Europe" },  { value: "waw", label: "Warsaw", description: "eu-central", group: "Europe" },  { value: "iad", label: "Ashburn", description: "us-east", group: "North America" },]}/>

Combobox is a Select you can type into: an input that filters as you type, with a chevron for browsing the whole list when you would rather look than search.

Reach for it the moment a list is long enough that scanning beats scrolling — countries, regions, repositories, people.

Usage

tsx
import { Combobox } from "@heyo-sh/heyo-ui";<Combobox options={regions} placeholder="Pick a region" />;

Multiple

With multiple, the chosen values become removable chips inside the control and the input keeps its place at the end of them. It is the only layout that survives ten selections without turning into a second row of chrome. maxChips collapses the rest into a +N.

Frankfurt
Warsaw
+1
<ComboboxmultiplemaxChips={2}defaultValue={["fra", "waw"]}placeholder="Pick regions"options={regions}/>

Groups, icons and descriptions

An option carries everything a row needs: a leading glyph, a second line, and the heading it belongs under. Rows sharing a group are collected in first-seen order — no nesting, no sorting on your side.

<Comboboxplaceholder="Assign to"options={[  { value: "ada", label: "Ada Lovelace", description: "ada@heyo.sh", icon: IconUser, group: "Maintainers" },  { value: "lin", label: "Linus", description: "linus@heyo.sh", icon: IconUser, group: "Contributors" },]}/>

Empty state

emptyMessage is what the reader sees when the filter matches nothing. Make it say what to do next — "No region matches" is better than "No results".

<Comboboxplaceholder="Pick a region"emptyMessage="No region matches that name."options={regions}/>
Which one?

Select for a short, known list. Combobox when it needs filtering. Command when the answer could be anything in the application.

Properties

optionsComboboxOption[]required

The full list. Each option takes value, label, and optionally description, icon, group and disabled.

value / defaultValuestring | null | string[]optional

Controlled and uncontrolled selection. With multiple, both are arrays.

onValueChange(value) => voidoptional

Fires with the new selection — a string or null, or an array with multiple.

multiplebooleanoptional

Turns the control into chips plus an input.

maxChipsnumberoptional

Beyond this many chips, the rest collapse into +N. multiple only.

clearablebooleanoptional

Shows a clear control on a single-value combobox. It defaults to true.

placeholderstringoptional

Placeholder for the input.

emptyMessageReactNodeoptional

Shown when the filter matches nothing.

maxHeightstringoptional

Cap on the list height. It defaults to "18rem".

size"xs" | "sm" | "base" | "lg"optional

Control height. It defaults to base.

disabledbooleanoptional

Dims the control and ignores interaction.

name / id / aria-labelstringoptional

Form and accessibility wiring. Give it an aria-label when there is no visible label.