Filter
Filter is used to let users narrow down content by selecting category tags.
Installation
npx jsx-daisyui add filterDefault
filter-default
Colors
filter-colors
Sizes
filter-sizes
Checkbox mode
filter-checkbox
Props
Filter
| Prop | Type | Default | Description |
|---|---|---|---|
asForm | boolean | true | Renders as a <form> when true, or a <div> when false. Use false when inside another form. |
name | string | - | Shared name attribute forwarded to every FilterItem via context. |
FilterReset
| Prop | Type | Default | Description |
|---|---|---|---|
mode | 'form' | 'radio' | 'form' | Use 'form' for native form reset, or 'radio' for non-form wrappers. |
label | string | '×' | Label shown on the reset button. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | - | The size of the filter reset. |
FilterItem
| Prop | Type | Default | Description |
|---|---|---|---|
type | 'radio' | 'checkbox' | 'radio' | The type of input element. |
label | string | - | Visible label rendered via aria-label (required). |
color | 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | 'ghost' | 'outline' | - | The color of the filter item. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | - | The size of the filter item. |