Skip to content

Commit 2fd66df

Browse files
committed
Add filter dropdown docs
1 parent afa34ce commit 2fd66df

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,48 @@
11
---
22
layout: "@demo/layouts/mdx-layout.astro"
33
heading: "Filter Dropdown"
4+
description: "A dropdown menu for selecting multiple filter options"
45
---
56

67
import { 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` | - ||

0 commit comments

Comments
 (0)