File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
packages/demo/src/content/components Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 11---
22layout : " @demo/layouts/mdx-layout.astro"
33heading : " Filter Dropdown"
4+ description : " A dropdown menu for selecting multiple filter options"
45---
56
67import { FilterDropdownDemo } from " @demo/components/demo/filter-dropdown" ;
78
9+ ## Overview
10+
11+ The Filter Dropdown component provides a multi-select dropdown for filtering content in tables or lists. The dropdown menu lists checkbox options that users can toggle on and off, with a "Clear all" action to reset selections within the component.
12+
13+ ## Usage
14+
15+ Import the component :
16+
17+ ``` tsx
18+ import { FilterDropdown } from " @eqtylab/equality" ;
19+ ```
20+
21+ Basic usage:
22+
23+ ``` tsx
24+ <FilterDropdown
25+ label = " Scope"
26+ options = { [
27+ { value: " organization" , label: " Organization" },
28+ { value: " project" , label: " Project" },
29+ ]}
30+ selectedFilters = { selectedFilters }
31+ onToggleFilter = { onToggleFilter }
32+ onClearAll = { onClearAll }
33+ />
34+ ```
35+
36+ ## Example
37+
838<FilterDropdownDemo client :only = " react" />
39+
40+ ## Props
41+
42+ | Name | Description | Type | Default | Required |
43+ | ----------------- | ------------------------------------------------------------ | ------------------------------------- | ------- | -------- |
44+ | ` label ` | The text displayed on the trigger button. | ` string ` | - | ✅ |
45+ | ` options ` | The list of filter options to display in the dropdown. | ` { value: string; label: string; }[] ` | - | ✅ |
46+ | ` selectedFilters ` | Array of currently selected filter values. | ` string[] ` | - | ✅ |
47+ | ` onToggleFilter ` | Callback fired when a filter option is checked or unchecked. | ` (value: string) => void ` | - | ✅ |
48+ | ` onClearAll ` | Callback fired when the "Clear all" button is clicked. | ` () => void ` | - | ✅ |
You can’t perform that action at this time.
0 commit comments