Skip to main content
Signature

Explore example code

Browse the Filter Numeric Range example code on GitHub.

About this widget

Filter Numeric Range is a filtering view made to filter between two numeric values. The most common interface for this is a slider. The Android View and Compose UI code samples (part of the Android widget showcase repository on GitHub) illustrate the use of sliders.

Examples

Kotlin

Low-level API

If you want to fully control the Filter Numeric Range components and connect them manually, use the following components:
  • Searcher. The Searcher that handles your searches.
  • FilterState. The current state of the filters.
  • FilterRangeViewModel. The logic applied to the numeric ranges.
  • NumberRangeView. The view that renders the numeric range filter.
Kotlin

Compose UI

InstantSearch provides the NumberRangeState as a state model, which is an implementation of the NumberRangeView interface. You need to connect NumberRangeState to the FilterRangeConnector or FilterRangeViewModel like any other NumberRangeView implementation.
Kotlin

Parameters

filterState
FilterState
required
The FilterState that will hold your filters.
attribute
String
required
The attribute to filter.
bounds
ClosedRange<T>?
The limits of the acceptable range within which values are coerced.
range
ClosedRange<T>?
The range of values within the bounds.

View

view
NumberRangeView
required
The view that renders the numeric range filter.
Kotlin
Last modified on July 10, 2026