Skip to content

hd-charge

Live preview

<hd-charge state="charging" power="{{ cap.measure_power }}" size="48px"></hd-charge>

Attributes and example

hd-charge

An EV charger’s bolt: rings pulse out while it charges (faster with more power), in while the car gives power back; paused or plugged in it rests. Reduced motion: still; e-ink snaps.

AttributeWhat it is
statecharging, giving, paused, plugged or unplugged. A live evcharger_charging_state is read in these words (evcharger_charging as charging or plugged). Or a live capability of any device, followed: {{ settings.x.cap.evcharger_charging_state }}.One of charging, giving, paused, plugged, unplugged. Default unplugged.
powerWatts; how fast the pulses go (1–11 kW). Or a live capability of any device, followed: {{ settings.x.cap.measure_power }}.
sizeCSS size, e.g. 36px; or set --size.Default 36px.
labelAccessible label; otherwise the state in words.
<hd-charge state="charging" power="{{ cap.measure_power }}" size="48px"></hd-charge>

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-flat
1 on e-ink: no colours, glows or gradients, only black and white.
--hd-lit
The warm colour of a device that is on.
--hd-motion-base
An ordinary change, like a value sliding.
--hd-motion-tempo
CSS input read by hd-charge.
--hd-text-faint
The quietest text: hints, units, times.
--hd-text-muted
Labels and secondary text.

Style the host

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