Skip to content

hd-value

Live preview

<hd-value value="{{ cap.measure_temperature }}" decimals="1" unit="°C"></hd-value>

Attributes and example

hd-value

A live number that counts to new values (or snaps, on e-ink).

AttributeWhat it is
valuerequiredThe number to show. Or a live capability of any device, followed: {{ settings.x.cap.measure_power }}.
decimalsDigits after the decimal point.Default 0.
unitUnit shown after the number, smaller.
<hd-value value="{{ cap.measure_temperature }}" decimals="1" unit="°C"></hd-value>

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-ease-out
The easing of most movement.
--hd-motion-fast
A quick change, like a press. 0ms when nothing may move.
--hd-motion-slow
A slow change, like a theme switching.
--hd-text-muted
Labels and secondary text.

Style the host

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