Skip to content

hd-gauge

Live preview

<hd-gauge value="{{ cap.target_temperature }}" marker="{{ cap.measure_temperature }}" zones="22:warn,26:danger">  <b>{{ cap.target_temperature.value | temp: 1 }}</b></hd-gauge>

Attributes and example

hd-gauge

A 270° dial filled up to a value within a range (target temperature, battery, power); what you put inside it (the value in words) sits a little below the dial’s centre (move it with middle-y), or stands on the base line of a half circle. Part: ::part(middle).

AttributeWhat it is
valueWhat it fills up to, e.g. {{ cap.target_temperature }} (its range then comes from the capability) or a number. Or a live capability of any device, followed: {{ settings.x.cap.measure_power }}.
minMinimum; defaults to the capability’s, else 0.
maxMaximum; defaults to the capability’s, else 100.
markerA second value shown as a dot on the dial, e.g. the current temperature. Or a live capability of any device, followed: {{ settings.x.cap.measure_power }}.
colorA theme colour name (accent, lit, cool, good, warn, danger, text, surface, canvas, chart-1…chart-6) or #rrggbb: whatever a Colour setting gives.One of accent, lit, cool, good, warn, danger, chart-1, chart-2, chart-3, chart-4, chart-5, chart-6.
sweepHow far round the dial goes: the classic 270°, a wider 240°, or a half circle (180), which is half as tall.One of 270, 240, 180. Default 270.
zonesStretches of the range in a colour (a theme colour name or #rrggbb), each from a value up to the next: 60:warn,80:danger. They tint the track (the empty part); how they colour the fill is zone-fill.
zone-fillHow the zones colour the fill: value (all of it in the colour of the zone the value is in), sections (each part in its zone’s colour, its own colour below the first zone) or track (always its own colour; the zones only tint the track).One of value, sections, track. Default value.
middle-yHow far below the dial’s centre what is inside it sits, in % of the radius: 0 is the exact middle, 25 (the default) a little lower toward the opening, negative higher; at most 60 either way. Not on a half circle.
<hd-gauge value="{{ cap.target_temperature }}" marker="{{ cap.measure_temperature }}" zones="22:warn,26:danger">  <b>{{ cap.target_temperature.value | temp: 1 }}</b></hd-gauge>

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-canvas
The page behind the tiles: a colour or a gradient.
--hd-ease-out
The easing of most movement.
--hd-motion-slow
A slow change, like a theme switching.
--hd-text
Text and big numbers.
--hd-track
The empty part of a slider, bar or ring.

Exposed parts

hd-gauge::part(middle) {  /* Your styles */}

Style the host

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