Clear all filter for facets

Hi Team, is there a “Clear All” functionality with facets rather than individually deselecting the filter on the right hand side or clicking the “x” in the category tag at the top of the screen? Thank you!

Hey Lily,

Yes, there is! You can utilize the resetFacets and resetFacetsLabel properties to add this functionality. Here is an example of the configuration:

"Facets": {
      "expand": false, // Allow the user to expand and collapse the facets
      "showMore": false, // Display a link to see more facet options within a facet
      "searchOnChange": true, // Will automatically run a search as facets are selected or unselected. Set to false to only trigger updates with an Apply button. 
      // Additional options are available in the documentation
      "resetFacets": "true",
      "resetFacetsLabel": "reset all"
}

The above configuration can be seen on the frontend below. You can then add any button styling you’d like!
Screen Shot 2021-10-21 at 10.21.10 AM

For more information on all possible Facet properties, reference the SDK documentation here.

DJ

Thank you DJ! I’ll make sure to reference the documentation!!