Skip to content

hd-alert

Live preview

<hd-alert kind="motion" active="{{ cap.alarm_motion }}" size="40px"></hd-alert>

Attributes and example

hd-alert

A sensor or alarm that says it went off, with its own icon: motion pings like a radar (then calmly while it still sees movement), smoke, CO and the siren shake and pulse while on, water ripples under a bobbing drop, a doorbell swings and rings twice. Its colour is the text colour around it. Reduced motion: a still halo; e-ink snaps.

AttributeWhat it is
kindWhich sensor or alarm.One of motion, smoke, co, water, siren, doorbell. Default motion.
activeWhether it is going off, e.g. {{ cap.alarm_smoke.value }}. Or a live capability of any device, followed: {{ settings.x.cap.onoff }}.
sizeCSS size, e.g. 30px; or set --size.Default 30px.
labelAccessible label; otherwise “Active” or “Quiet”.
<hd-alert kind="motion" active="{{ cap.alarm_motion }}" size="40px"></hd-alert>

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-ease-out
The easing of most movement.
--hd-flat
1 on e-ink: no colours, glows or gradients, only black and white.
--hd-motion-base
An ordinary change, like a value sliding.
--hd-motion-tempo
CSS input read by hd-alert.

Style the host

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