Import
Basic Usage
Props
Array of options.
Render the input. Signature:
function(params: object) => ReactNode. params contains props to apply to the input element.The value of the autocomplete. The value must have reference equality with the option in order to be selected. You can customize the equality behavior with the
isOptionEqualToValue prop.The default value. Use when the component is not controlled.
The input value.
If
true, value must be an array and the menu will support multiple selections.If
true, the popup won’t close when a value is selected.If
true, the component is disabled.If
true, the input can’t be cleared.If
true, the Autocomplete is free solo, meaning that the user input is not bound to provided options.If
true, the portion of the selected suggestion that the user hasn’t typed, if there is one, is automatically appended to the textbox.If
true, the first option is automatically highlighted.If
true, the selected option becomes the value of the input when the Autocomplete loses focus unless the user chooses a different option or changes the character string in the input.If
true, the component is in a loading state. This shows the loadingText in place of suggestions (only if there are no suggestions to show, for example options are empty).Text to display when in a loading state.
Text to display when there are no options.
If
true, the component is shown.The size of the component.
Used to determine the string value for a given option. It’s used to fill the input (and the list box options if
renderOption is not provided).Used to determine if the option represents the given value. Uses strict equality by default. Both arguments need to be handled, an option can only match with one value.
A filter function that determines the options that are eligible. Signature:
function(options: Array<T>, state: object) => Array<T>.If provided, the options will be grouped under the returned string. The groupBy value is also used as the text for group headings when
renderGroup is not provided.onChange
(event: React.SyntheticEvent, value: T | T[] | null, reason: string, details?: object) => void
Callback fired when the value changes.
Callback fired when the input value changes.
Callback fired when the popup requests to be opened. Use in controlled mode (see
open).Callback fired when the popup requests to be closed. Use in controlled mode (see
open).Render the option, use
getOptionLabel by default. Signature: function(props: object, option: T, state: object) => ReactNode.Render the group. Signature:
function(params: AutocompleteRenderGroupParams) => ReactNode.Render the selected value.
Props applied to the Chip element.
The system prop that allows defining system overrides as well as additional CSS styles.
API Reference
- Autocomplete API
- Uses useAutocomplete hook