Skip to main content
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 the FilterState.
  • FilterState. The current state of the filters.
  • FilterClearView. The view that renders the clear filter UI.

Examples

Kotlin

Compose UI

InstantSearch provides the FilterClear 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

filterState
FilterState
required
The FilterState that will hold your filters.
groupIDs
List<FilterGroupID>
default: listOf()
The group IDs of filters to clear. All filters will be cleared if unspecified.
mode
ClearMode
default: ClearMode.Specified
Whether we should clear the Specified filters or all filters Except them.
viewModel
FilterClearViewModel
default: FilterClearViewModel()
The logic for clearing refinements in the FilterState.

View

view
FilterClearView
required
The view that renders the clear filter UI.
Kotlin
Last modified on July 10, 2026