An element whose children are **real HTML**: the browser lays them out at the element's box size and the result is drawn into the box via the [html-in-canvas](https://github.com/WICG/html-in-canvas) API. The Diffusion Studio app ships with this API enabled, so `<html>` is always available — reach for it liberally. It is the recommended way to build motion graphics, overlays, and any UI-heavy content: styled cards, tables, code blocks, flex/grid layouts — anything painful to assemble from `<rect>` and `<text>`.
Driving the markup with an [anime.js](https://animejs.com) timeline is **recommended** — it keeps the animation frame-accurate: build the timeline with `autoplay: false`, then `seek` it from the [`useTicker`](./lifecycle.md#useticker) playhead so it follows scrubbing and exports rather than the wall clock. anime.js works in milliseconds, so the playhead is scaled by 1000 on the way into `seek`.
Prefer this timeline over hand-animating styles: keep the markup static and let the paused anime.js timeline own every moving value, so one `seek` keeps the whole host frame-accurate. A static `style` may be a plain string, but one spanning multiple lines has to be a template literal in braces (`style={`…`}`), as above. Reach for a derived style only for values the timeline does not drive, and write it as a **style object** (`style={{ color: c() }}`) rather than interpolating the signal into a style string, so each property updates independently.
The `<html>` box carries all [common props](./elements.md#common-props). Its paint child form, [`<htmlPaint>`](./paints.md), draws the same reactive HTML onto any existing filled geometry; `<html>` is just a `<rect>` that carries one.
The children are part of the project's Solid graph: signals in attributes and text update the live DOM, and the drawn content follows on the next frame. A mounted project stays live, so the graph keeps running and `useTicker` or timers can drive the markup:
`<img>` takes the same sources as a composition [`src`](./media.md): a path, an asset id, a URL, or a [`generate.*`](./generate.md) ref. The host resolves them exactly as it does for [`<image>`](./image.md)
The module is re-executed in every context: on reload, export, and [`capture`](../tools/capture.md) the engine re-executes it and rebuilds the DOM content in that context. Exports wait for the browser's rendering update before sampling each frame, so the drawn HTML appears in the output; ticker-driven signals follow the playhead and animate frame-accurately. This assumes the module's structure is deterministic (`Math.random()`/`Date.now()` must not decide the shape of the tree).
-`<audio>` and `<video>` tags are rejected: media doesn't play under a paint host. Use the [`<audio>`](./audio.md) and [`<video>`](./video.md) composition elements, which own playback and the timeline. `<canvas>` is rejected too — its pixels don't survive the rasterization; use [`<surface>`](./surface-paint.md).
- **Composition elements cannot appear inside HTML content, and DOM elements cannot appear outside it.** Both are errors at mount, naming which way round it went.
- Pointer and media event handlers on the DOM children are ignored: the subtree is rasterized into the canvas, not interacted with. Styles, classes, attributes, `innerHTML` and `textContent` all apply and are reactive.
- **`scale()` blanks large or clipped subtrees in captures.** The rasterizer renders a subtree as *empty* when a CSS `scale()` sits on a large wrapper (e.g. a full-box `width:100%;height:100%` group), or when any `overflow:hidden` clip lives beneath a scaled ancestor. Animate entrances, holds, and exits with `translate` and `opacity`; use `scale` only on small, content-sized leaf elements with no clipping inside them. A masked text reveal (`overflow:hidden` + inner `translateY`) is fine as long as no ancestor of the mask carries a transform.
- **Fractional `opacity` on a painted box blanks the subtree in captures.** Under an ancestor whose `opacity` is fractional (a wrapper mid-fade), a descendant that carries *both* its own `opacity`<1*and*apaintedbox—`background`,`border`,`box-shadow`,`outline`—makestherasterizerdroptheancestor'sentiresubtreeforexactlyaslongastheancestor'sopacityisfractional,sothecontentisblankmid-fadeandpopsinthemomentthefadelandson1.Splittingthetwoacrossaparentandachilddoesnothelp;nordoes`will-change`,`isolation`,`contain`,or`filter: opacity()`.Dimming**text**with`opacity`isfine,andsoisaboxwhosebackgroundisdimmedwithanalphacolor—givedecoratedboxes`rgba()`/`hsl()`alphainsteadof`opacity`.Intheliveeditorthedroppedsubtreedoesnotjustgoblank:thepromotedlayerescapesthecanvasandpaintsitselfontopofthestageatthecanvas'stop-leftcorner,atauthoredsize,withnocameraorscenetransform—HTMLcontentappearinguntransformedoverthestageinsteadofinsideitssceneisthisbug,notabrokentransform.