Skip to main content
Signature

Explore example code

Browse the Filter Numeric Comparison example code on GitHub.

About this widget

Filter Numeric Comparison is a view to filter on a numeric value using a comparison operator.

Examples

Kotlin

Low-level API

If you want to fully control the Filter Numeric Comparison components and connect them manually, use the following components:
  • Searcher. The Searcher that handles your searches.
  • FilterState. The current state of the filters.
  • NumberViewModel<T>. The logic applied to the numeric value.
  • NumberView<T>. The view that renders the numeric value.
Kotlin

Compose UI

InstantSearch provides the NumberState as a state model, which is an implementation of the NumberView interface. You need to connect NumberState to the FilterComparisonConnector or NumberViewModel like any other NumberView implementation.
Kotlin

Parameters

filterState
FilterState
required
The FilterState that holds filters.
attribute
String
required
The attribute to filter on.
operator
NumericOperator
required
The NumericOperator used to perform a numeric comparison.
number
T : Number, T : Comparable<T>
default: null
Initial numeric value to filter on.
groupID
FilterGroupID
default: FilterGroupID(attribute, FilterOperator.And)
Groups all created filters under an ID and composes them with this operator. Defaults to the used attribute, with FilterOperator.And between filters in this group.

View

view
NumberView<T>
required
The view that renders the numeric value.
presenter
NumberPresenter<T>
default:"NumberPresenterImpl"
How to display the numeric value.
Kotlin
Last modified on July 10, 2026