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

View

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