Skip to main content

<Filters/>

A filters component

Example

index.tsx
import {Results, ProductGrid,FastSimonApi,SearchBox,Filters} from "fast-component-library";
import React from "react";

export const App = () => {
return (
<FastSimonApi storeID={1} uuid={"rand-omuu-id12-3456"}>
<header>
Search: <SearchBox/>
</header>

<Results>
<Filters/>
<ProductGrid/>
</Results>
</FastSimonApi>
)
}

Props

OptionTypeDescription
classNamestringMain wrapper custom class
loaderReact.ReactNode (default=
)
Product card id
renderFilterRenderFilterFuncrender a custom filter. undefined will render default
redirectTypeRedirectTypesingle-page - will use
to url, multi page will redirect to url directly
removableTagsboolean (default=true)show selected filter tags on the top of the filter
removableTagsCustomClassesRemovableTagsCustomClassesCustom classes for the removable tags
removableTagsCloseIconReact.ReactNodeCustom close icon for the removable tags
onCategoryFilterClick(category: FastCategory) => voidcallback when a category filter is clicked (collection only)

Types

import {CategoryFacetValue, FacetValue, Narrow} from "fast-simon-sdk"
import React from "react";

type RenderFilterFunc = ({}: { id: string, values: FacetValue[] | CategoryFacetValue[], name: string, setNarrow: (narrow?: Narrow[]) => void }) => React.ReactNode

interface RemovableTagsCustomClasses {
wrapper?: string
item?: string
clearAll?: string
}

References

  1. AddToCart
  2. Badges
  3. Swatches