Preview
No fruit selected
Design guidance
Combobox renders its chips through TagItem and TagItem.Remove. InputGroup owns the field boundary; Chips lays out the selected values. Put Clear and Trigger inside InputGroup.Addon to use the shared inset ghost icon buttons. Caller-provided render values remain supported.
Selected options use a trailing checkmark and no resting background. Input focus changes the border color through --input-focus-border-color. Group labels share --menu-label-color, --menu-label-font-size, --menu-label-font-weight, and --menu-label-text-transform with Select and Autocomplete. Compose Separator between groups. Status and Empty share padding and typography; keep Status mounted and update its children.
Use Combobox for a bounded choice with filtering. Use Select for a short fixed list and Menu or DropdownMenu for actions. Use Tag Input for freeform tag editing.
| Need | Choose |
|---|---|
| Search a set of choices | Combobox filters known values. |
| Short fixed choices | Select shows the list without a search input. |
Installation
Install the local ghost-kit source bundle while the registry runs at localhost:3110. It contains this component and its source dependencies. Prepare the local registry first so token dependencies also resolve locally.
Basic usage
Structure
Examples
Multiple select
Select several programming languages. Each selected value becomes a removable chip.
Input inside popup
Open the country selector, then search inside its popup.
Creatable
Pick an existing issue label or create the name entered in the field.
Grouped
Find produce in Fruit and Vegetable groups.
Async search, single
Search a delayed local reviewer fixture. Loading, no match, failure, and retry appear in the popup. Older query results cannot replace newer ones.
Async search, multiple
Search the same local fixture and add several reviewers as removable chips.
Virtualized
Search a 240-project list. The popup mounts only rows near the viewport and scrolls with keyboard navigation.
API reference
Combobox.ItemIndicator renders a standard Check icon by default. Supply children for a custom indicator; refs, render, and keepMounted remain available.
For inherited behavior and additional part properties, see the Base UI Combobox API.
| Prop | Type | Default | Description |
|---|---|---|---|
form | string | Identifies the form that owns the internal input. Useful when the combobox is rendered outside the form. | |
filter | ((item: Item, query: string, itemToString?: ((item: Item) => string)) => boolean) | null | Filter function used to match items vs input query. Receives the source item, which is the derived value's item when `items` is a `createItems()` collection, and the item itself otherwise. | |
disabled | boolean | false | Whether the component should ignore user interaction. |
name | string | Identifies the field when a form is submitted. | |
id | string | The id of the component. | |
children | React.ReactNode | Sets children. | |
grid | boolean | false | Whether list items are presented in a grid layout. When enabled, arrow keys navigate across rows and columns inferred from DOM rows. |
inline | boolean | false | Whether the list is rendered inline without using the component's own popup. Specify `open` unconditionally in conjunction with this prop so the list is considered visible: `<Combobox.Root inline open>` In a `Combobox.Root` > `Dialog.Root` composition, bind the Combobox's `open` and `onOpenChange` props to the `Dialog`'s `open` and `onOpenChange` state instead so the component resets its transient state (filter query, highlighted item, and input value) when the dialog closes. |
loopFocus | boolean | true | Whether to loop keyboard focus back to the input when the end of the list is reached while using the arrow keys. The first item can then be reached by pressing <kbd>ArrowDown</kbd> again from the input, or the last item can be reached by pressing <kbd>ArrowUp</kbd> from the input. The input is always included in the focus loop per [ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/). When disabled, focus does not move when on the last element and the user presses <kbd>ArrowDown</kbd>, or when on the first element and the user presses <kbd>ArrowUp</kbd>. |
readOnly | boolean | false | Whether the user should be unable to choose a different option from the popup. |
required | boolean | false | Whether the user must choose a value before submitting a form. |
modal | boolean | false | Determines if the popup enters a modal state when open. - `true`: user interaction is limited to the popup: document page scroll is locked and pointer interactions on outside elements are disabled. - `false`: user interaction with the rest of the document is allowed. On touch devices, a `true` modal blocks outside taps but leaves the page scrollable unless the popup spans nearly the full viewport width, matching native iOS behavior. |
open | boolean | Whether the popup is currently open. Use when controlled. | |
defaultOpen | boolean | false | Whether the popup is initially open. To render a controlled popup, use the `open` prop instead. |
onOpenChangeComplete | ((open: boolean) => void) | Event handler called after any animations complete when the popup is opened or closed. | |
items | readonly any[] | readonly Group<any>[] | ComboboxItemCollection<Item, Value> | The items to be displayed in the list. Can be a flat array of items, an array of groups with items, or a collection created by the `createItems()` function, which derives each item's selection value and label. Nullish entries are not supported: remove them from the data before passing it. | |
inputValue | string | number | readonly string[] | The input value of the combobox. Use when controlled. | |
defaultInputValue | string | number | readonly string[] | The uncontrolled input value when initially rendered. To render a controlled input, use the `inputValue` prop instead. | |
openOnInputClick | boolean | true | Whether the popup opens when clicking the input. |
filteredItems | readonly Item[] | readonly Group<Item>[] | Filtered items to display in the list. When provided, the list uses these items instead of filtering the `items` prop internally. When `items` is also provided, this array must preserve its flat or grouped structure. With a `createItems()` collection, pass source items rather than derived values. Nullish entries are not supported, as in `items`. Use when you want to control filtering logic externally with the `useFilter()` hook. | |
inputRef | React.Ref<HTMLInputElement> | A ref to the hidden input element. | |
virtualized | boolean | false | Whether the items are being externally virtualized. |
limit | number | -1 | The maximum number of items to display in the list. |
locale | Intl.LocalesArgument | The locale to use for string comparison. Defaults to the user's runtime locale. | |
multiple | Multiple | false | Whether multiple items can be selected. |
autoComplete | string | Provides a hint to the browser for autofill. | |
autoHighlight | boolean | false | Whether the first matching item is highlighted automatically while filtering. |
highlightItemOnHover | boolean | true | Whether moving the pointer over items should highlight them. Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state. |
itemToStringLabel | ((itemValue: Value) => string) | When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for display in the input. If the shape of the object is `{ value, label }`, the label will be used automatically without needing to specify this prop. With a `createItems()` collection, this receives the derived value, and the collection's `getLabel` takes precedence for values it can resolve. | |
itemToStringValue | ((itemValue: Value) => string) | When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for form submission. If the shape of the object is `{ value, label }`, the value will be used automatically without needing to specify this prop. With a `createItems()` collection, this receives the derived value. | |
isItemEqualToValue | ((itemValue: Value, value: Value) => boolean) | Custom comparison logic used to determine if a combobox item value matches the current selected value. Useful when item values are objects without matching referentially. With a `createItems()` collection, both arguments are derived values. Defaults to `Object.is` comparison. | |
defaultValue | (Multiple extends true ? Value[] : Value) | null | The uncontrolled selected value of the combobox when it's initially rendered. To render a controlled combobox, use the `value` prop instead. | |
actionsRef | React.RefObject<AriaCombobox.Actions | null> | A ref to imperative actions. - `unmount`: Manually unmounts the combobox. Call this after any externally controlled closing animation finishes. | |
onOpenChange | ((open: boolean, eventDetails: Combobox.Root.ChangeEventDetails) => void) | Event handler called when the popup is opened or closed. | |
onInputValueChange | ((inputValue: string, eventDetails: Combobox.Root.ChangeEventDetails) => void) | Event handler called when the input value changes. | |
onItemHighlighted | ((highlightedValue: Value, eventDetails: Combobox.Root.HighlightEventDetails) => void) | Callback fired when an item is highlighted or unhighlighted. Receives the highlighted item value (or `undefined` if no item is highlighted) and event details with a `reason` property describing why the highlight changed. The `reason` can be: - `'keyboard'`: the highlight changed due to keyboard navigation. - `'pointer'`: the highlight changed due to pointer hovering. - `'none'`: the highlight changed programmatically. | |
value | (Multiple extends true ? Value[] : Value) | null | The selected value of the combobox. Use when controlled. | |
onValueChange | ((value: (Multiple extends true ? Value[] : Value) | (Multiple extends true ? never : null), eventDetails: Combobox.Root.ChangeEventDetails) => void) | Event handler called when the selected value of the combobox changes. |