Intro
Basic Usage
Result
Non removable single select
Live Editor
<FilterBaraddFilterOptions={[{ label: 'Client Age', disabled: false },{ label: 'Client Age Group', disabled: false },]}><SingleSelectFilterremovable={false}filterName="Non removable single select"options={[{ label: 'Option1', value: 'o1' },{ label: 'Option2', value: 'o2' },]}/></FilterBar>
Non-Removable Filters
These types of Filters are not removable from a FilterBar through UI. There are no onRemove callbacks associated with them. All Filters default to being non-removable.
Result
Non removable single select
Live Editor
<SingleSelectFilterfilterName="Non removable single select"options={[{ label: 'Option1', value: 'o1' },{ label: 'Option2', value: 'o2' },]}/>
Removable Filters
These types of filters are removable from a FilterBar through UI.
Result
Removable single select
Live Editor
<SingleSelectFilterremovablefilterName="Removable single select"options={[{ label: 'Option1', value: 'o1' },{ label: 'Option2', value: 'o2' },]}/>
Prefix and Suffix
All filters support the renderPrefix
and renderSuffix
props to allow for custom content to be rendered before and after the filter name.
Result
Number
DateRange
SingleSelect
MultiSelect
CollapsibleSingleSelect
CollapsibleMultiSelect
Live Editor
<div className="d-flex flex-wrap"><NumberFilterrenderPrefix={() => <span className="icon-placeholder"></span>}renderSuffix={() => <span className="icon-placeholder"></span>}filterName="Number"className="me-3 mb-2"/><DateRangeFilterrenderPrefix={() => <span className="icon-placeholder"></span>}renderSuffix={() => <span className="icon-placeholder"></span>}filterName="DateRange"className="me-3 mb-2"minYear={2000}maxYear={2010}/><SingleSelectFilterrenderPrefix={() => <span className="icon-placeholder"></span>}renderSuffix={() => <span className="icon-placeholder"></span>}filterName="SingleSelect"className="me-3 mb-2"options={[{ label: 'Option1', value: 'o1' },{ label: 'Option2', value: 'o2' },]}/><MultiSelectFilterrenderPrefix={() => <span className="icon-placeholder"></span>}renderSuffix={() => <span className="icon-placeholder"></span>}filterName="MultiSelect"className="me-3 mb-2"options={[{ label: 'Option1', value: 'o1' },{ label: 'Option2', value: 'o2' },]}/><CollapsibleSingleSelectFilterrenderPrefix={() => <span className="icon-placeholder"></span>}renderSuffix={() => <span className="icon-placeholder"></span>}filterName="CollapsibleSingleSelect"className="me-3 mb-2"options={[{ label: 'Option1', id: 'o1' },{ label: 'Option2', id: 'o2' },]}/><CollapsibleMultiSelectFilterrenderPrefix={() => <span className="icon-placeholder"></span>}renderSuffix={() => <span className="icon-placeholder"></span>}filterName="CollapsibleMultiSelect"className="me-3 mb-2"options={[{ label: 'Option1', id: 'o1' },{ label: 'Option2', id: 'o2' },]}/></div>
Size
All filters support the size
prop to allow for custom sizing of the trigger.
Result
Number
DateRange
SingleSelect
MultiSelect
CollapsibleSingleSelect
CollapsibleMultiSelect
Number
DateRange
SingleSelect
MultiSelect
CollapsibleSingleSelect
CollapsibleMultiSelect
Live Editor
<><div className="d-flex flex-wrap"><NumberFilter filterName="Number" size="sm" className="me-3 mb-2" /><DateRangeFilterfilterName="DateRange"size="sm"className="me-3 mb-2"minYear={2000}maxYear={2010}/><SingleSelectFilterfilterName="SingleSelect"size="sm"className="me-3 mb-2"options={[{ label: 'Option1', value: 'o1' },{ label: 'Option2', value: 'o2' },]}/><MultiSelectFilterfilterName="MultiSelect"size="sm"className="me-3 mb-2"options={[{ label: 'Option1', value: 'o1' },{ label: 'Option2', value: 'o2' },]}/><CollapsibleSingleSelectFilterfilterName="CollapsibleSingleSelect"size="sm"className="me-3 mb-2"options={[{ label: 'Option1', id: 'o1' },{ label: 'Option2', id: 'o2' },]}/><CollapsibleMultiSelectFilterfilterName="CollapsibleMultiSelect"size="sm"className="me-3 mb-2"options={[{ label: 'Option1', id: 'o1' },{ label: 'Option2', id: 'o2' },]}/></div><div className="d-flex flex-wrap"><NumberFilter filterName="Number" size="lg" className="me-3 mb-2" /><DateRangeFilterfilterName="DateRange"size="lg"className="me-3 mb-2"minYear={2000}maxYear={2010}/><SingleSelectFilterfilterName="SingleSelect"size="lg"className="me-3 mb-2"options={[{ label: 'Option1', value: 'o1' },{ label: 'Option2', value: 'o2' },]}/><MultiSelectFilterfilterName="MultiSelect"size="lg"className="me-3 mb-2"options={[{ label: 'Option1', value: 'o1' },{ label: 'Option2', value: 'o2' },]}/><CollapsibleSingleSelectFilterfilterName="CollapsibleSingleSelect"size="lg"className="me-3 mb-2"options={[{ label: 'Option1', id: 'o1' },{ label: 'Option2', id: 'o2' },]}/><CollapsibleMultiSelectFilterfilterName="CollapsibleMultiSelect"size="lg"className="me-3 mb-2"options={[{ label: 'Option1', id: 'o1' },{ label: 'Option2', id: 'o2' },]}/></div></>