UseAutocompleteProps

external interface UseAutocompleteProps<Value> : Props(source)

Properties

Link copied to clipboard
abstract var autoComplete: Boolean?

If true, the portion of the selected suggestion that the user hasn't typed, known as the completion string, appears inline after the input cursor in the textbox. The inline completion string is visually highlighted and has a selected state.

Link copied to clipboard
abstract var autoHighlight: Boolean?

If true, the first option is automatically highlighted.

Link copied to clipboard
abstract var autoSelect: Boolean?

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.

Link copied to clipboard
abstract var blurOnSelect: BlurOnSelect?

Control if the input should be blurred when an option is selected:

Link copied to clipboard
abstract var clearOnBlur: Boolean?

If true, the input's text is cleared on blur if no value is selected.

Link copied to clipboard
abstract var clearOnEscape: Boolean?

If true, clear all values when the user presses escape and the popup is closed.

Link copied to clipboard
abstract var componentName: String?

The component name that is using this hook. Used for warnings.

Link copied to clipboard
abstract var defaultValue: dynamic

The default value. Use when the component is not controlled.

Link copied to clipboard
abstract var disableClearable: Boolean?

If true, the input can't be cleared.

Link copied to clipboard

If true, the popup won't close when a value is selected.

Link copied to clipboard
abstract var disabled: Boolean?

If true, the component is disabled.

Link copied to clipboard

If true, will allow focus on disabled items.

Link copied to clipboard
abstract var disableListWrap: Boolean?

If true, the list box in the popup will not wrap focus.

Link copied to clipboard

A function that determines the filtered options to be rendered on search.

Link copied to clipboard

If true, hide the selected options from the list box.

Link copied to clipboard
abstract var freeSolo: Boolean?

If true, the Autocomplete is free solo, meaning that the user input is not bound to provided options.

Link copied to clipboard
abstract var getOptionDisabled: (option: Value) -> Boolean?

Used to determine the disabled state for a given option.

Link copied to clipboard
abstract var getOptionKey: (option: Value) -> Any?

Used to determine the key for a given option. This can be useful when the labels of options are not unique (since labels are used as keys by default).

Link copied to clipboard
abstract var getOptionLabel: (option: Value) -> String?

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).

Link copied to clipboard
abstract var groupBy: (option: Value) -> String?

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.

Link copied to clipboard
abstract var handleHomeEndKeys: Boolean?

If true, the component handles the "Home" and "End" keys when the popup is open. It should move focus to the first option and last option, respectively.

Link copied to clipboard
abstract var id: String?

This prop is used to help implement the accessibility logic. If you don't provide an id it will fall back to a randomly generated one.

Link copied to clipboard

If true, the highlight can move to the input.

Link copied to clipboard
abstract var inputValue: String?

The input value.

Link copied to clipboard
abstract var isOptionEqualToValue: (option: Value, value: Value) -> Boolean?

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.

Link copied to clipboard
abstract var key: Key?
Link copied to clipboard
abstract var multiple: Any?

If true, value must be an array and the menu will support multiple selections.

Link copied to clipboard
abstract var onChange: (event: SyntheticEvent<*, *>, value: Any, reason: AutocompleteChangeReason, details: AutocompleteChangeDetails<Value>?) -> Unit?

Callback fired when the value changes.

Link copied to clipboard
abstract var onClose: (event: SyntheticEvent<*, *>, reason: AutocompleteCloseReason) -> Unit?

Callback fired when the popup requests to be closed. Use in controlled mode (see open).

Link copied to clipboard
abstract var onHighlightChange: (event: SyntheticEvent<*, *>, option: Value?, reason: AutocompleteHighlightChangeReason) -> Unit?

Callback fired when the highlight option changes.

Link copied to clipboard
abstract var onInputChange: (event: SyntheticEvent<*, *>, value: String, reason: AutocompleteInputChangeReason) -> Unit?

Callback fired when the input value changes.

Link copied to clipboard
abstract var onOpen: (event: SyntheticEvent<*, *>) -> Unit?

Callback fired when the popup requests to be opened. Use in controlled mode (see open).

Link copied to clipboard
abstract var open: Boolean?

If true, the component is shown.

Link copied to clipboard
abstract var openOnFocus: Boolean?

If true, the popup will open on input focus.

Link copied to clipboard
abstract var options: ReadonlyArray<Value>

Array of options.

Link copied to clipboard
abstract var readOnly: Boolean?

If true, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.

Link copied to clipboard
abstract var selectOnFocus: Boolean?

If true, the input's text is selected on focus. It helps the user clear the selected value.

Link copied to clipboard
Link copied to clipboard
abstract var value: Any?

The value of the autocomplete.

Functions

Link copied to clipboard
open inline operator fun Props?.unaryPlus()