useSearchFieldState

Provides state management for a search field.

installyarn add @react-stately/searchfield
version3.1.7
usageimport {useSearchFieldState} from '@react-stately/searchfield'

API#


useSearchFieldState( (props: SearchFieldProps )): SearchFieldState

Interface#


Properties

NameTypeDescription
valuestringThe current value of the search field.

Methods

MethodDescription
setValue( (value: string )): voidSets the value of the search field.

Example#


See the docs for useSearchField in react-aria for an example of useSearchField.