InstantSearch
/
React
/
V6
/
API reference
Aug. 07, 2023
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
Copy
1
2
3
import { ClearRefinements } from 'react-instantsearch-dom';
<ClearRefinements />
Props
clearsQuery
Optional
Type:
boolean
Whether the widget should include the query.
Copy
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.
Copy
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.
Copy
1
2
3
4
5
<ClearRefinements
translations={{
reset: 'Clear all filters',
}}
/>
Did you find this page helpful?