How to show the number of applied facet filters?

I’m using InstantSearch.js for the search UI.

On mobile devices the refinement lists are shown in an off-screen panel that is available via the ”Filter” button. In normal state it is hidden. I’d like to show the number of applied facet filters on the button itself: e.g. “Filter (2)”.

How to achieve this with InstantSearch.js?

Hi there,

To count the number of current filters applied you can use the current refinements widget. You may need to customize it. Here’s an example: CurrentRefinements | React InstantSearch | API parameters | API Reference | Algolia Documentation that can help you.

I hope that it helps!

Thank you, I thought so.