hd-slider
on changeA slider bound to a numeric capability (dim, target temperature, volume…) with bind (or the explicit form: value with data-hd-on-change). It sends the value once, on release. With fill it is the whole tile: put it in the tile and the template’s own content inside it (<hd-slider fill bind="…">name and value</hd-slider>); its value is a wash rising from the bottom (or growing from the left) with a grip on its edge, dragged anywhere by how far it moves; a tap glides it to the tapped spot, or with tap="tile" is the tile’s own tap. A fill slider’s colours are CSS properties, any colour or gradient: --hd-slider-tone (the edge and grip), --hd-slider-fill (the wash, laid across the whole tile and uncovered as it grows) and --hd-slider-track (the rest).
| Attribute | What it is |
|---|---|
bind | The capability it is bound to, e.g. {{ settings.light.cap.dim }} (the whole capability, no .value): it shows its value, takes min, max and step from it, and sends changes back (shown at once, sprung back if refused, range checked). A device that is unavailable shows its last value, disabled. |
value | The explicit form instead of bind: what it shows, e.g. {{ cap.dim.value }} (or a live capability, followed); a change only goes to data-hd-on-change, which decides what it does. Without a handler it can’t be changed. |
min | Minimum; defaults to the capability’s. |
max | Maximum; defaults to the capability’s. |
step | Step; defaults to the capability’s. |
tone | Track colour; warmth is a cool-to-warm track for colour temperature, muted a dimmed one for something switched off.One of accent, lit, cool, warmth, muted. Default accent. |
label | Accessible label. |
fill | The whole tile is the slider: it fills the box it sits in (give that box position: relative and rounded corners of its own), the content inside it drawn on top. |
direction | Which way a fill slider grows; left out, right in a clearly wide box (5:4 and wider) and up in any other.One of up, right. |
tap | What a tap without dragging does on a fill slider: set glides it to the tapped spot; tile leaves the tap to the tile around it (switching the lamp), so only a drag changes the value.One of set, tile. Default set. |
<hd-slider bind="{{ cap.dim }}" label="Brightness"></hd-slider>