<sk-live-annotation>

← prev index next →

Pins live, interactive HTML/SVG/Markdown to a point in the 3D scene — a real DOM label or panel that can sit behind geometry like part of the world.

Remarks

This is the live-DOM 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 is that the content is a real, live DOM element layered over the canvas — so it takes full CSS styling, CSS animations and transitions, and pointer interaction — and it is depth-aware: it can be occluded by 3D geometry in front of it (governed by the scene's live-annotation occlusion setting), so a label reads as belonging to the scene rather than floating above it.

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

Related. For content that must always stay on top and never be hidden by geometry (a HUD, a tooltip), use sk-overlay-annotation; for SVG drawn into the scene as a genuinely 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