Skip to Content

Combobox

A text input that filters a dropdown of options as you type. For async / server-side filtering, control the text with inputValue + onInputChange and swap options yourself. allowCustomValue accepts free text that matches no option.

import { Combobox } from '@gg-software/ui'; <Combobox label="Assignee" options={people} onChange={(value) => setAssignee(value)} /> // async filtering <Combobox options={results} inputValue={query} onInputChange={(text) => { setQuery(text); fetchResults(text); }} /> // free text allowed <Combobox options={suggestions} allowCustomValue />

Options use the same SelectOption shape as Select.

Props

PropTypeDefaultDescription
options*SelectOption<T>[]
valueT | null
defaultValueT | nullnull
onChange((value: T | null, option: SelectOption<T> | null) => void)
inputValuestringcontrolled input text (for server-side / async filtering)
onInputChange((text: string) => void)
allowCustomValuebooleanfalseaccept text that doesn't match any option (best with string options)
placeholderstringType to search…
labelReactNode
hintReactNode
errorReactNode
requiredboolean
size"sm" | "md" | "lg"md
status"warning" | "error"
disabledbooleanfalse
clearablebooleanfalse
filterOption((query: string, option: SelectOption<T>) => boolean)
emptyTextReactNodeNo options
idstring
namestring
classNamestring

* required · generated from packages/ui/src/input/Combobox/Combobox.tsx