Skip to main content

Sidebar Filters

Renders a column of nested menus containing filters with a submit button, active filters are shown and can be canceled

Storybook Docs

Props

NameTypeDefaultDescription
activeFiltersISidebarFilter[][]Array of active filter values
defaultOpenedActiveFiltersbooleanetrueDefine if collapse of active filters tags is opened
defaultOpenedMenuIdsnumber | string[]Default collapse menu opened
deleteButtonLabelstring"Remove all"Label of button that removes all active filters
filterButtonLabelstring"Filter"Label of submit button
menusIMenuItem<string | number>[][]Array of nested menus containing filters
titleReactNode"Active filters"Title shown at the top of the column
closeAllFiltersLabelstring"Close all"Label of button close all filters
onDeleteButtonClick(filters: ISidebarFilter[]) => void-Called when an active filter is removed
onFilterButtonClick(filters: ISidebarFilter[]) => void-Called when submit button is clicked
openAllFiltersLabelstring"Open all"Label of button open all filters

ISidebarFilter

AttributeTypeDescription
categoryId(number | string)[]Array of parents ids in the menus
idnumber | stringNested array of menus
labelstringFilter(s) contained in the menu
onRemove(filter: ISidebarFilter) => voidFilter(s) contained in the menu
valueunknownFilter(s) contained in the menu