Skip to content

hd-bulb

Live preview

<hd-bulb on="{{ cap.onoff }}" level="{{ cap.dim }}" size="48px"></hd-bulb>

Attributes and example

hd-bulb

A light bulb that blooms on and fades off, and spills its light around it, wider and stronger the brighter it is (the tile clips it). Reduced motion fades; e-ink snaps without a glow.

AttributeWhat it is
onWhether it is lit; a change blooms it on or fades it off. Or a live capability of any device, followed: {{ settings.x.cap.onoff }}.
levelBrightness 0–1, e.g. {{ cap.dim.value }}; missing is full. Or a live capability of any device, followed and fitted into its own range: {{ cap.measure_battery }} (0–100) just works.
iconAnother icon to draw it with, e.g. {{ device.icon }} (the one picked for the lamp in Homey); its light opens the same way. Missing is the bulb.
sizeCSS size, e.g. 18px; or set --size.Default 1em.
labelAccessible label; otherwise “On” or “Off”.
<hd-bulb on="{{ cap.onoff }}" level="{{ cap.dim }}" size="48px"></hd-bulb>

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-bulb-glow
CSS input read by hd-bulb.
--hd-bulb-off
CSS input read by hd-bulb.
--hd-bulb-spill
CSS input read by hd-bulb.
--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-bulb.
--hd-text-muted
Labels and secondary text.

Style the host

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