beta

useAutocompleteState

Provides state management for an autocomplete component.

installyarn add @react-stately/autocomplete
version3.0.0-beta.0
usageimport {useAutocompleteState} from '@react-stately/autocomplete'

API#


useAutocompleteState( (props: )):

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.