Android
Signature
Explore example code
Browse the Clear Filters example code on GitHub.
About this widget
ClearFilters lets users clear all refinements that are currently active within the given FilterState.
To add ClearFilters to your search experience, use these components:
FilterClearViewModel. The logic for clearing refinements in theFilterState.FilterState. The current state of the filters.FilterClearView. The view that renders the clear filter UI.
Examples
Kotlin
Compose UI
InstantSearch provides theFilterClear as a state model,
which is an implementation of the FilterClearView interface.
You need to connect FilterClear to the FilterClearConnector or FilterClearViewModel like any other FilterClearView implementation.
Kotlin
Parameters
The
FilterState that will hold your filters.The group IDs of filters to clear.
All filters will be cleared if unspecified.
Whether we should clear the
Specified filters or all filters Except them.The logic for clearing refinements in the FilterState.
View
The view that renders the clear filter UI.
Kotlin