Skip to content

hd-door

Live preview

<hd-door open="{{ cap.alarm_contact }}" size="40px"></hd-door>

Attributes and example

hd-door

A door in its frame for a contact sensor: it swings open on its hinge (past where it stops, and back) with the light of the room beyond showing through, and swings shut with a small bounce. Its colour is the text colour around it. Reduced motion: no swing; e-ink snaps.

AttributeWhat it is
openWhether it is open; a change swings it. Or a live capability of any device, followed: {{ settings.x.cap.onoff }}.
sizeIts width (CSS), e.g. 40px; or set --size.Default 40px.
labelAccessible label; otherwise “Open” or “Closed”.
<hd-door open="{{ cap.alarm_contact }}" size="40px"></hd-door>

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-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-door.
--hd-surface-raised
Something on a tile that stands out from it, like a button.

Style the host

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