<sk-overlay-annotation>

← prev index next →

Pins HTML/SVG/Markdown to a point in the 3D scene that is ALWAYS on top — a HUD, tooltip, or badge that geometry can never hide.

Remarks

This is the always-on-top member of the AbstractDomAnnotationNode annotation family: like every annotation its content is the element's own body and it tracks a world position as the camera moves. What distinguishes it from a sk-live-annotation is that it never participates in depth testing — its layer draws above all scene content and every other annotation, so it is never occluded. That makes it the choice for UI that must stay readable no matter what is in front of it: heads-up displays, tooltips, always-accessible panels, debug overlays.

Key attributes. The body content is the element's children (HTML, SVG, or — with md — Markdown), not an attribute; it is real, interactive DOM with full CSS (including animations). anchor chooses which edge sits on the world point; scale-with-distance makes it shrink with perspective. Content is not sanitized, so untrusted markup must be sanitized by the author first.

Related. When an annotation should read as part of the world and be hidden by geometry in front of it, use sk-live-annotation instead; for SVG drawn into the scene as a depth-tested texture, use sk-rasterized-annotation.

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
id <id> The element's unique identifier — the standard HTML global id attribute.
draggable <boolean> false Gets whether this node can be dragged.
xanimatable <number> 0 X position.
yanimatable <number> 0 Y position.
zanimatable <number> 0 Z position.
hanimatable <angle> 0 Heading (Y-axis rotation) in radians.
panimatable <angle> 0 Pitch (X-axis rotation) in radians.
banimatable <angle> 0 Bank (Z-axis rotation) in radians.
quaternionanimatable <quaternion> ({ <number>, <number>, <number>, <number> }) Rotation as quaternion (overrides h, p, b if provided)
sxanimatable <number> 1 X-axis scale factor.
syanimatable <number> 1 Y-axis scale factor.
szanimatable <number> 1 Z-axis scale factor.
s <number> Uniform scale factor for all axes (overrides sx, sy, sz if provided) write-only
md <boolean> false When true, treat AbstractDomAnnotationConfig.content as
anchor <anchor> ("center" | "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right") "center" The anchor point for positioning the annotation.
scale-with-distance <boolean> false If true, maintains constant screen size; if false, scales with perspective.

Event handler attributes

Standard DOM event-handler content attributes — the value is JavaScript run when the event fires. They behave exactly as on any HTML element.

onclick, ondblclick, onauxclick, oncontextmenu, onpointerdown, onpointerup, onpointermove, onpointercancel, onpointerover, onpointerout, onpointerenter, onpointerleave, ongotpointercapture, onlostpointercapture, onwheel, ondragstart, ondrag, ondragenter, ondragover, ondragleave, ondrop, ondragend