Signature
Explore example code
Browse the FilterList (Facet) example code on GitHub.
About this widget
FilterList.Facet is a filtering view that displays any kind of facet filters and lets users refine their search results by selecting them.
Compared to the RefinementList,
which takes its values from the search response facets, this widget displays facet filters that you add yourself.
Examples
Kotlin
Low-level API
If you want to fully control theFilterList.Facet components and connect them manually, use the following components:
Searcher: TheSearcherthat handles your searches.FilterState: The current state of the filters.FilterListViewModel.Facet: The logic applied to the facet filters.FilterListView.Facet: The view that renders the facet filters.FilterPresenter: Optional. The presenter to customize the display of the filters.
Kotlin
Compose UI
InstantSearch provides theFilterListState as a state model, which is an implementation of the FilterListView interface.
You need to connect FilterListState to the FilterListConnector or FilterListViewModel like any other FilterListView implementation.
Kotlin
Parameters
List<Filter.Facet>
required
default: listOf()
The facet filters to display.
FilterState
required
The
FilterState that will hold your filters.SelectionMode
default: Multiple
Whether the list can have
Single or Multiple selections.FilterGroupID
default: FilterGroupID(FilterOperator.Or)
The identifier for the group of filters.
View
FilterListView.Facet
The view that renders the filters.
Kotlin