InstantSearch / React / V6 / API reference

ClearRefinements | React InstantSearch V6 (Deprecated)

This version of React InstantSearch has been deprecated in favor of the latest version of React InstantSearch.

Signature

Signature
<ClearRefinements
  // Optional parameters
  clearsQuery={boolean}
  transformItems={function}
  translations={object}
/>

About this widget

The ClearRefinements widget displays a button that lets the user clears every currently applied refinement.

Examples

1
2
3
import { ClearRefinements } from 'react-instantsearch-dom';

<ClearRefinements />

Props

clearsQuery

Optional
Type: boolean

Whether the widget should include the query.

1
<ClearRefinements clearsQuery />

transformItems

Optional
Type: function

Modifies the items being displayed, for example, to filter or sort them. It takes items as argument and expects them back in return.

1
2
3
4
5
<ClearRefinements
  transformItems={items =>
    items.filter(({ attribute }) => attribute !== 'brand')
  }
/>

translations

Optional
Type: object

A mapping of keys to translation values.

  • reset: label for the clear refinement button.
1
2
3
4
5
<ClearRefinements
  translations={{
    reset: 'Clear all filters',
  }}
/>
Did you find this page helpful?