Filter
The filter component is a button that is used to filter the items of a list or table.
Version 0.5.0
Installation
To install @igloo-ui/filter
in your project, you will need to run the following command using npm:
npm install @igloo-ui/filter
If you prefer Yarn, use the following command instead:
yarn add @igloo-ui/filter
Usage
Then to use the component in your code just import it!
import Filter from '@igloo-ui/filter';
<Filter
onClick={() => {
setSelected(!selected);
alert('Filter was clicked');
}}
selected={selected}
>
Assigned to me (5)
</Filter>;
API
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | - | Add the main text/icon to the filter |
className | string | - | Add class names to the filter |
dataTest | string | - | Add a data-test tag for automated tests |
disabled | boolean | - | True if the filter should be disabled |
onClick | (e?: SyntheticEvent<Element, Event>) => void | - | Add an event for when the filter is clicked |
selected | boolean | - | True if the tag is selected |