Component
FilterPanel
A filter area that expands under its toggle, on an auto-fit grid.
import { FilterPanel } from '@loidolt/theme-svelte';
Example
Notes
- The toggle is yours: a
Buttonwitharia-expandedandaria-controlspointing at the panelid. - Closed, the controls are
inert— out of the tab order and the accessibility tree — while the height still animates. - Set
--ldt-minto change the column width. "Clear all" appears whenactiveCountis above zero andonClearis given.
Props
Generated from the component source, so it cannot drift from the implementation.
| Prop | Type | Default | Notes |
|---|---|---|---|
children required | Snippet | — | The filter controls, laid out on an auto-fit grid (--ldt-min sets the column width). |
activeCount | number | 0 | How many filters are set; shows "Clear all" when above zero and onClear is given. |
class | string | — | |
clearLabel | string | 'Clear all' | |
label | string | 'Filters' | Accessible name of the region. |
onClear | () => void | — | |
open bindable | boolean | false | Whether the panel is expanded. The toggle is yours — a Button with aria-expanded={open} and aria-controls set to this panel's id. |
ref bindable | HTMLDivElement | null | null |
Plus the attributes of HTMLAttributes<HTMLDivElement>, forwarded to the root element.