Skip to content

hd-playpause

Live preview

<button data-hd-on-click="toggle('speaker_playing')">  <hd-playpause playing="{{ cap.speaker_playing }}" size="24px"></hd-playpause></button>

Attributes and example

hd-playpause

A play/pause button face that turns from one into the other; it shows what a tap does. Reduced motion: a fade; e-ink snaps.

AttributeWhat it is
playingWhether it plays (then it shows pause). Or a live capability of any device, followed: {{ settings.x.cap.onoff }}.
sizeCSS size, like hd-icon’s.Default 1em.
<button data-hd-on-click="toggle('speaker_playing')">  <hd-playpause playing="{{ cap.speaker_playing }}" size="24px"></hd-playpause></button>

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-motion-fast
A quick change, like a press. 0ms when nothing may move.
--hd-motion-tempo
CSS input read by hd-playpause.

Style the host

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