Skip to content

hd-place

Attributes and example

hd-place

Puts what is inside it (an hd-icon, an hd-image, anything) at a spot and size of its own, over or behind the rest, relative to the widget (or the nearest element with position: relative). What is inside fills its box.

AttributeWhat it is
atOne of nine spots; sets x, y and anchor at once.One of top-left, top-center, top-right, middle-left, middle-center, middle-right, bottom-left, bottom-center, bottom-right.
xAcross, from 0 (left edge) to 100 (right edge); wins over at.
yDown, from 0 (top) to 100 (bottom); wins over at.
anchorWhich point of the box sits at x, y: the same as at unless given, else the middle.One of top-left, top-center, top-right, middle-left, middle-center, middle-right, bottom-left, bottom-center, bottom-right.
sizesmall, medium, large or huge (24, 40, 64 or 96 px); or a width: a share of the widget (40%) or pixels (56px).Default medium.
ratioWidth to height of the box: 1, 1.5, 4/3 or 16/9.Default 1.
layerOver the content, or behind it (and then it takes no taps).One of front, back. Default front.
<hd-place at="top-right" size="large">  <hd-icon name="device.light"></hd-icon></hd-place>

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-place {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables