Skip to content

hd-widget

Attributes and example

hd-widget

Draws another widget inside this one, filling its box, as a full tile with its own frame, style, taps and history. Name what it shows with device, flow or mood, with the built-in type or, left out, the best fit. Only this tile’s own device, and devices, flows and moods its settings chose, are drawn; anything else draws nothing. It is one level deep (a child draws no widgets of its own), and drawn and kept live only while on screen.

AttributeWhat it is
deviceA device to draw, e.g. {{ d.id }}; must be this tile’s own or one its settings chose.
flowA flow to draw as a button; must be one its settings chose.
moodA mood to draw as a button; must be one its settings chose.
tileThe id of a child tile of this one, e.g. {{ t.id }}, instead of device, flow or mood. Comes with the tiles setting: until then nothing is drawn for it.
typeThe built-in widget to draw it with, written out, e.g. light.basic; not a value, and not this widget’s own type. Left out, the one that fits best.
{% for d in settings.lights %}  <hd-widget device="{{ d.id }}" type="light.basic"></hd-widget>{% endfor %}

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.

No component-specific CSS variables are exposed. Use the host element’s sizing and the documented theme variables.

Style the host

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