An input with a filterable list of options to choose one or several from.
autoComplete |
string |
| – |
Provides a hint to the browser for autofill. |
autoHighlight | boolean | false | Whether the first matching item is highlighted automatically while filtering. |
children | ReactNode | – | The content of the component. |
defaultInputValue | string | number | readonly string[] | – | The uncontrolled input value when initially rendered. To render a controlled input, use the |
defaultOpen | boolean | false | Whether the popup is initially open. To render a controlled popup, use the |
defaultValue | ComboboxInputValue<Value, Multiple> | null | – | The uncontrolled selected value of the combobox when it's initially rendered. To render a controlled combobox, use the |
disabled | boolean | false | Whether the component should ignore user interaction. |
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 |
filteredItems | readonly Item[] | readonly Group<Item>[] | – | Filtered items to display in the list. When provided, the list uses these items instead of filtering the |
form | string | – | Identifies the form that owns the internal input. Useful when the combobox is rendered outside the form. |
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. |
highlightItemOnHover | boolean | true | Whether moving the pointer over items should highlight them. Disabling this prop allows CSS |
id | string | – | The id of the component. |
inline | boolean | false | Whether the list is rendered inline without using the component's own popup. Specify In a |
inputRef | Ref<HTMLInputElement> | – | A ref to the hidden input element. |
inputValue | string | number | readonly string[] | – | The input value of the combobox. Use when controlled. |
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 |
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 |
itemToStringLabel | ((itemValue: Value) => string) | – | When the item values are objects ( |
itemToStringValue | ((itemValue: Value) => string) | – | When the item values are objects ( |
limit | number | -1 | The maximum number of items to display in the list. |
locale | LocalesArgument | – | The locale to use for string comparison. Defaults to the user's runtime locale. |
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>. |
modal | boolean | false | Determines if the popup enters a modal state when open.
On touch devices, a |
multiple | Multiple | false | Whether multiple items can be selected. |
name | string | – | Identifies the field when a form is submitted. |
onInputValueChange | ((inputValue: string, eventDetails: ChangeEventDetails) => void) | – | Event handler called when the input value changes. |
onItemHighlighted | ((highlightedValue: Value, eventDetails: HighlightEventDetails) => void) | – | Callback fired when an item is highlighted or unhighlighted. Receives the highlighted item value (or
|
onOpenChange | ((open: boolean, eventDetails: OpenChangeEventDetails) => void) | – | Event handler called when the popup is opened or closed. |
onOpenChangeComplete | ((open: boolean) => void) | – | Event handler called after any animations complete when the popup is opened or closed. |
onValueChange | ((value: ComboboxOutputValue<Value, Multiple> | (Multiple extends true ? never : null), eventDetails: ChangeEventDetails) => void) | – | Event handler called when the selected value of the combobox changes. |
open | boolean | – | Whether the popup is currently open. Use when controlled. |
openOnInputClick | boolean | true | Whether the popup opens when clicking the input. |
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. |
value | ComboboxInputValue<Value, Multiple> | null | – | The selected value of the combobox. Use when controlled. |
virtualized | boolean | false | Whether the items are being externally virtualized. |
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.