Current section

Files

Jump to
noora docs components filterdefinition.md
Raw

docs/components/filterdefinition.md

<!-- Generated by scripts/generate-web-components.js. Do not edit directly. -->
# FilterDefinition
Describes one filter that a user can add.
```html
<noora-filter-definition name="status" label="Status" type="option"><noora-filter-option value="active">Active</noora-filter-option></noora-filter-definition>
```
## Attributes
| Attribute | Type or allowed values | Default | Description |
| --- | --- | --- | --- |
| `name` | `string` | `""` | Sets the filter identifier. |
| `label` | `string` | `""` | Sets the filter label. |
| `type` | `option`, `text`, `number`, `percentage`, `list` | `"option"` | Sets the filter value type and available operators. |
| `operator` | `==`, `!=`, `=~`, `!=~`, `<`, `>`, `<=`, `>=` | None | Sets the initial comparison operator. |
| `default-value` | `string` | None | Sets the value used when the filter is added. |
| `searchable` | `boolean` | `false` | Adds search to option-value menus. |
## Slots
| Slot | Description |
| --- | --- |
| `default` | The allowed noora-filter-option children. |
## Definition
Describe an available filter and its values.
```html
<noora-filter-definition name="status" label="Status" type="option"><noora-filter-option value="active">Active</noora-filter-option></noora-filter-definition>
```