The Filters component is a versatile component that can be used to filter data based on user-defined criteria.
The component can be imported via:
The Filters component provides a flexible way to implement filtering interfaces with different filter types. It includes subcomponents for displaying active filters, adding new filters, and clearing all filters.
The Filters component supports various types of filters:
Select popoverisSearchable: true to enable search functionality within the popoverSelect popoverisSearchable: true to enable search functionality within the popoverWhen using the custom type, it is required to also provide the following options with the filter definition:
selectedLabel - a function that accepts the current value and returns a string to display in the filter tageditComponent - a component which will be rendered inside the popover when the filter tag is clicked. The component will receive the following props:
filter - the filter definitionvalue - the current value of the filteronChange - a callback to call when the value of the filter is changedcloseDropdown - a function that can be called to close the dropdown programmaticallySet isAlwaysShown: true to keep a filter always visible, even when empty. This is useful to highlight important filters that users are more likely to interact with.
The Filters component can be used with a custom layout by providing children. The component provides a context value that contains all the necessary state and functions.
PlumaFilters extends BoxThe button variant of the "add filter" component.
Whether the "add button" dropdown should render in an open state by default.
The filters which will be displayed
Whether the filters are disabled
Called when a filter value changes
Clears a filter
Clears all filters
Called when a filter is selected within the dropdown
The values of the filters
Optional icon to display alongside the filter label
Whether to always show this filter, even if it's not filled. When enabled, the filter will always be visible in the active list.
The key of the filter
The label of the filter
The options for the filter
Renders the text inside the pill when a value is set
The type of the filter
Optional icon to display alongside the filter label
Whether to always show this filter, even if it's not filled. When enabled, the filter will always be visible in the active list.
The key of the filter
The label of the filter
The options for the filter
Renders the text inside the pill when a value is set
The type of the filter
Optional icon to display alongside the filter label
Whether to always show this filter, even if it's not filled. When enabled, the filter will always be visible in the active list.
Function to determine if a date is disabled and cannot be selected. This takes precedence over minDate and maxDate if provided.
The key of the filter
The label of the filter
The maximum selectable date.
The minimum selectable date.
Renders the text inside the pill when a value is set
The type of the filter
Optional icon to display alongside the filter label
Whether to always show this filter, even if it's not filled. When enabled, the filter will always be visible in the active list.
Function to determine if a date is disabled and cannot be selected. This takes precedence over minDate and maxDate if provided.
The key of the filter
The label of the filter
The maximum selectable date.
The minimum selectable date.
An array of presets to render instead of the default ones.
Renders the text inside the pill when a value is set
The type of the filter
Whether the date picker should show preset selection.
Only available when isRange is true.
Optional icon to display alongside the filter label
Whether to always show this filter, even if it's not filled. When enabled, the filter will always be visible in the active list.
Whether the select options should be searchable (via an input inside the options menu).
The key of the filter
The label of the filter
The options for the filter. Supports all Select option features including groups, icons, descriptions, etc.
Renders the text inside the pill when a value is set
The type of the filter
Optional icon to display alongside the filter label
Whether to always show this filter, even if it's not filled. When enabled, the filter will always be visible in the active list.
Whether the select options should be searchable (via an input inside the options menu).
The key of the filter
The label of the filter
The options for the filter. Supports all Select option features including groups, icons, descriptions, etc.
Renders the text inside the pill when a value is set
The type of the filter
The component to render inside the popover when editing this filter
Optional icon to display alongside the filter label
Whether to always show this filter, even if it's not filled. When enabled, the filter will always be visible in the active list.
The key of the filter
The label of the filter
Renders the text inside the pill when a value is set
The type of the filter
Whether the filter is disabled
The key of the filter
The value of the filter
PlumaFiltersActiveList extends BoxCustom className for each active item in the list. Use this with caution as it's not guaranteed to be stable between versions.
PlumaFiltersAddButton extends ButtonWhether the add button is disabled
PlumaFiltersClearAllButton extends LinkWhether the clear all button is disabled