Facets Widget JS


The SearchStax Site Search solution’s Facets Widget for UX-JS displays faceted filters for search.

Facet Selection and Order

Facet lists are configured and ordered on the Site Search Faceting Tab.

Usage

searchstax.addFacetsWidget("searchstax-facets-container", {
    facetingType: "and",
    itemsPerPageDesktop: 3,
    itemsPerPageMobile: 99,
 });

Multiple Instances

Multiple instances of the Facets widget can be added by calling the addFacetsWidget method multiple times with different target containers:

searchstax.addFacetsWidget('container1', options1);

searchstax.addFacetsWidget('container2', options2);

Each instance can be configured separately via its options object. This allows for the widget to be added to different locations on the page as needed.

Props

  • facetingType: “and” | “or” | “showUnavailable” | “tabs”. Type that determines how facets will behave.
  • specificFacets: string[]. Optional array of facet names that, if provided, will only render those facets.
  • itemsPerPageDesktop: number. Default expanded facets for desktop.
  • itemsPerPageMobile: number. Default expanded facets for mobile.
  • templates: See examples in searchstax-ux-js.

Example

See the full examples in searchstax-ux-js.

Questions?

Do not hesitate to contact the SearchStax Support Desk.