GodUI

Combobox

A type-ahead autocomplete with staggered result reveal, highlighted matches, keyboard navigation, and an async loading state.

Assignee

Search teammates by name

Installation

pnpm dlx shadcn@latest add "https://godui.design/r/combobox.json"

Usage

tsx
 
import { Combobox } from "@/components/godui/combobox";
tsx
 
const [value, setValue] = useState("");

<Combobox options={options} value={value} onChange={setValue} />;

Examples

Pass onSearch to resolve options for a query — it debounces input and shows a loading state while results arrive.

Framework

Results resolve from an async source with a loading state.

Props

PropTypeDefaultDescription
optionsComboboxOption[]Static options ({ label, value, description? })
onSearch(query) => Promise<ComboboxOption[]>Async resolver (overrides options)
valuestringControlled selected value
defaultValuestring""Uncontrolled initial value
placeholderstring"Search…"Input placeholder
emptyMessagestring"No results"Shown when nothing matches
onChange(value, option) => voidCalled on selection

On this page

Built with GodUI

Beautifully crafted motion components for modern interfaces.

Star on GitHub