This library is still in development and is available only for internal usage at VTEX.
Skip to main content

Search

Search

Version: Next

Search

Search inputs allow merchants to filter by free form content that can't be classified in predefined options.





Disabled



Internationalized Placeholder



Debounce


A common UX pattern is to filter the collections (or make a query) while the user types the input. To do that performatively, we often use debounced values. You can use the `useSearchState`` hook which stores a debounced value for you.


Value:

DebouncedValue:


Persisted state in query params


You can persist the search value within the browser's query params using the useQuerySearchState hook, instead of useSearchState. The application should be wrapped by QueryStateProvider. Watch how your url changes (note that the persisted value is the debounced value).


Value:

DebouncedValue: