Combobox
Type to filter a list, pick with keyboard or pointer. Values come from the list only — free text reverts on blur. A hidden input carries the form value.
Example
- Ada Lovelace
- Grace Hopper
- Alan Turing
<Combobox
id="ship-to"
label="Ship to"
name="ship-to"
options={["Ada Lovelace", { value: "gk", label: "Grace Hopper" }, "Alan Turing"]}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | - | Input id; label targets it. |
label | string | - | Visible label and clear-button name. |
name | string | id | Hidden input form name. |
options | Array<string | { value; label; disabled? }> | - | Selectable items. |
value | string | "" | Preselected option value. |
placeholder | string | - | Input placeholder. |
class | string | - | Style passthrough. |
| Plus the Field API (hint, error, required, disabled). | |||
Accessibility
- Combobox pattern:
aria-expanded,aria-controls,aria-activedescendant. - List-only values: stray text reverts to the selected label on blur.
- Clear button is named (
Clear …); Escape closes the list.