A searchable list of commands, usually opened as a palette with a keyboard shortcut.
close: Closes the autocomplete imperatively when called.autoHighlight | boolean|"always" | false | Whether the first matching item is highlighted automatically.
|
children | ReactNode | – | The content of the component. |
defaultOpen | boolean | false | Whether the popup is initially open. To render a controlled popup, use the |
defaultValue | string | number | readonly string[] | – | The uncontrolled input value of the autocomplete when it's initially rendered. To render a controlled autocomplete, use the |
disabled | boolean | false | Whether the component should ignore user interaction. |
filter | AriaCombobox.Props<ItemValue, 'none'>['filter'] | – | Filter function used to match items against the input query. |
filteredItems | readonly unknown[] | readonly Group<unknown>[] | – | 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 autocomplete 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 |
inputRef | Ref<HTMLInputElement> | – | A ref to the hidden input element. |
items | readonly unknown[] | – | The items to be displayed in the list. Can be either a flat array of items or an array of groups with items. Nullish entries are not supported: remove them from the data before passing it. |
itemToStringValue | ((itemValue: unknown) => string) | – | When the item values are objects ( |
keepHighlight | boolean | false | Whether the highlighted item should be preserved when the pointer leaves the list. |
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 |
mode | "none"|"inline"|"list"|"both" | 'list' | Controls how the autocomplete behaves with respect to list filtering and inline autocompletion.
|
name | string | – | Identifies the field when a form is submitted. |
onItemHighlighted | ((highlightedValue: unknown, eventDetails: HighlightEventDetails) => void) | – | Callback fired when an item is highlighted or unhighlighted. Receives the highlighted item value (or
|
onOpenChange | ((open: boolean, eventDetails: AutocompleteRootOpenChangeEventDetails) => 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: string, eventDetails: AutocompleteRootChangeEventDetails) => void) | – | Event handler called when the input value of the autocomplete changes. |
open | boolean | – | Whether the popup is currently open. Use when controlled. |
openOnInputClick | boolean | false | 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. |
submitOnItemClick | boolean | false | Whether clicking an item should submit the autocomplete's owning form. By default, clicking an item via a pointer or <kbd>Enter</kbd> key does not submit the owning form. Useful when the autocomplete is used as a single-field form search input. |
value | string | number | readonly string[] | – | The input value of the autocomplete. 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 render, plus every native <div> attribute.
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 render, plus every native <div> attribute.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts render, plus every native <kbd> attribute.
CommandCreateHandle is called, not rendered. It creates a handle: pass it as handle to a trigger and to the root, and the trigger can sit anywhere in the tree, outside the root.
undefined