Skip to main content
Signature

Explore example code

Browse the Hierarchical Menu example code on GitHub.

About this widget

A Hierarchical Menu is a component that displays a hierarchical navigation menu, based on facet attributes.

Examples

Kotlin

Low-level API

If you want to fully control the Hierarchical Menu components and connect them manually, use the following components:
  • Searcher. The Searcher that handles your searches.
  • FilterState. The current state of the filters.
  • HierarchicalViewModel. The logic applied to the hierarchical facets.
  • HierarchicalView. The concrete hierarchical view.
  • HierarchicalPresenter. The presenter that controls the sorting and other settings of the hierarchical menu.
  • HierarchicalItem. A single node in the hierarchy.
Kotlin

Compose UI

InstantSearch provides HierarchicalState as a state model, which implements the HierarchicalView interface. You need to connect HierarchicalState to the HierarchicalConnector or HierarchicalViewModel like any other HierarchicalView implementation.
Kotlin

Parameters

searcher
HitsSearcher
required
The Searcher that handles your searches.
attribute
String
required
The attribute to filter.
filterState
FilterState
required
The FilterState that holds your filters.
hierarchicalAttributes
List<String>
required
The names of the hierarchical attributes that you need to target, in ascending order.
separator
String
required
The delimiter used to separate hierarchical facets. Usually something like ” > ”, including spaces as shown in this example.

View

view
HierarchicalView
required
The view that renders the hierarchical menu.
presenter
HierarchicalPresenter
required
How to display the list of HierarchicalItem. Takes a list of HierarchicalItem and returns a new list of HierarchicalItem. A HierarchicalItem contains a Facet, its level, and a displayName.
Kotlin
Last modified on July 10, 2026