Skip to content

hd-stepper

Live preview

<hd-stepper bind="{{ cap.target_temperature }}" step="0.5" decimals="1"></hd-stepper>

Attributes and example

hd-stepper

on change

− and + beside a value, for what is set in steps: a setpoint, a volume, a fan speed. Bound to a numeric capability with bind (or the explicit form: value with data-hd-on-change). A press steps once; held, it keeps stepping. The value shows at once, and the steps go out as one command once the presses stop, shown as on their way until the Homey reports back. − and + grey out at the ends. The buttons’ colours are CSS properties: --hd-stepper-button, --hd-stepper-button-text and --hd-stepper-button-hover; parts: ::part(button), ::part(minus), ::part(plus).

AttributeWhat it is
bindThe 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.
valueThe explicit form instead of bind: what it shows, e.g. {{ cap.target_temperature.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.
minMinimum; defaults to the capability’s.
maxMaximum; defaults to the capability’s.
stepStep; defaults to the capability’s, else 1.
unitShown after the value; defaults to the capability’s.
decimalsDigits after the decimal point.
layoutcolumn stacks it for a tall, narrow tile: + on top, the value, − below.One of row, column. Default row.
toneThe colour of a button under the pointer and of a value on its way.One of accent, lit, cool. Default accent.
labelAccessible label; defaults to the capability’s name.
<hd-stepper bind="{{ cap.target_temperature }}" step="0.5" decimals="1"></hd-stepper>

Styling

Set CSS variables on the component element. Its internal elements live in Shadow DOM; only the exposed named parts can be styled with ::part.

--hd-accent
The theme’s accent: active controls, links, highlights.
--hd-cool
The cool counterpart: cooling, cold water, low prices on some themes.
--hd-ease-out
The easing of most movement.
--hd-ease-spring
A springy easing, for things that bounce into place.
--hd-focus
The outline round what has keyboard focus.
--hd-font-display
The font of big numbers and headings.
--hd-font-ui
The font of labels and running text.
--hd-lit
The warm colour of a device that is on.
--hd-motion-base
An ordinary change, like a value sliding.
--hd-motion-fast
A quick change, like a press. 0ms when nothing may move.
--hd-press
What a press does, as a transform; each control’s own shrink when unset.
--hd-stepper-button
CSS input read by hd-stepper.
--hd-stepper-button-hover
CSS input read by hd-stepper.
--hd-stepper-button-text
CSS input read by hd-stepper.
--hd-text
Text and big numbers.
--hd-text-muted
Labels and secondary text.

Exposed parts

hd-stepper::part(button) {  /* Your styles */}hd-stepper::part(minus) {  /* Your styles */}hd-stepper::part(plus) {  /* Your styles */}

Style the host

hd-stepper {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables