This is the React InstantSearch v7 documentation.
If you’re upgrading from v6, see the upgrade guide.
If you were using React InstantSearch Hooks,
this v7 documentation applies—just check for necessary changes.
To continue using v6, you can find the archived documentation.
About this widget
TheuiState
object represents the state of the search UI and can be saved and returned to later.
It’s updated whenever the user interacts with the UI and can be used to:
- Store the current search query and parameters
- Pass data to widgets
- Determine which results to show when a user visits a new page (routing)
Example
This is an example of an InstantSearchuiState
object.
It represents what the user has searched for, how they’ve refined the results, and how the results are displayed.
Replace INDEX_NAME
with the name of your Algolia index.
TypeScript
Custom widgets
To have your custom widgets interact with theuiState
object,
you need to implement the getWidgetUiState
and getWidgetSearchParameters
methods in the connector.
To learn more, see Custom widgets.