beta

useAutocompleteState

Provides state management for an autocomplete component.

installyarn add react-stately
version3.37.1
usageimport {useAutocompleteState} from 'react-stately'

API#


useAutocompleteState( (props: AutocompleteStateOptions )): AutocompleteState

Interface#


Properties

NameTypeDescription
inputValuestringThe current value of the autocomplete input.
focusedNodeIdstringnullThe id of the current aria-activedescendant of the autocomplete input.

Methods

MethodDescription
setInputValue( (value: string )): voidSets the value of the autocomplete input.
setFocusedNodeId( (value: stringnull )): voidSets the id of the current aria-activedescendant of the autocomplete input.