Haedong
028

Combobox

Form

No value

Customize

Field
Disabled

Code

<Field label="Timezone">
  <Combobox
    options={TIMEZONES}
    placeholder="Pick a timezone"
    value={tz}
    onValueChange={setTz}
  />
</Field>

Install

npx shadcn@latest add https://components.haedong.dev/r/combobox.json

Props

Data-driven like Select; each option may carry keywords for the filter. Label it with aria-label / aria-labelledby or wrap it in Field.

PropTypeDescription
options{ value; label; keywords?; disabled? }[]The choices. The filter matches value, label and keywords.
value / defaultValuestringSelected value (controlled / uncontrolled).
onValueChange(value: string) => voidCalled on click or Enter; the popover then closes.
placeholder / searchPlaceholder / emptyTextstringTrigger placeholder, search prompt, and the empty line. Defaults "Select" / "Search" / "No results".
namestringRenders a hidden input so the value submits with a form.