Help guide

DOM animation guide

Updated June 19, 2026

DOM animation guide

Product media placeholder

Replace this area with a screenshot or short walkthrough video during the media sweep.

DOM animation writes to real webpage elements. Good DOM motion starts with stable selectors, one owner per property, visible validation output, and breakpoints that match the page layout.

Two DOM authoring paths

  • domGraph.nodes[] is the graph-based path for modern DOM motion. It uses serialized graph nodes with params and connections.
  • dom[] is the older parameter-driven animation array. It still supports selector, driver, driverType, from, to, keyframes, duration, splitText, and scroll options.
  • Use domGraph when the motion needs multiple nodes, derived values, validation, reusable templates, scroll/pointer inputs, or wireable selectors.

DOM animation fields

  • DomAnimation.selector is required.
  • driverType supports scroll, bool, and float.
  • mode supports time and scroll.
  • splitText supports chars, words, and lines.
  • scroll options include trigger, start, end, scrub, pin, pinSpacing, anticipatePin, markers, scroller, toggleActions, and once.

Writer ownership rules

  • A target property should have one owner. Two graph branches writing the same transform component can trigger MULTIPLE_TRANSFORM_WRITERS_SAME_COMPONENT.
  • Use one boundary writer for grouped transform work when the values belong together.
  • Use CSS custom variables for values the page style sheet should consume, and direct property writes when the graph should own the visible property.

Verified runnable example

This guide points to proof-backed sample coverage. The full ledger lives in Generated examples and proof log.

DOM: Scroll fade reveal

  • Source: faster-motion/demo/tests/dom/catalog/scroll-animations/fade-reveal/fade-reveal.domgraph.fmtion
  • Expected output: Sections fade and translate into place as their trigger elements enter the configured viewport range.
  • Validation: Schema validation passed. Runtime proof reports zero structural/runtime issues and 17 loaded nodes.
  • Desktop proof: generated-assets/faster-motion-docs/proofs/screenshots/dom-fade-reveal-desktop.png
  • Mobile proof: generated-assets/faster-motion-docs/proofs/screenshots/dom-fade-reveal-mobile.png

Guide-specific sample target: DOM hero sample with scroll progress, one remap, one opacity writer, one translate writer, and a validation screenshot with no warnings.

Faster Motion docs

Use this local map together with the left navigation. The source-backed content tree controls the main article order; this section keeps related pages one click away.

Start

DOM animation

Canvas animation

3D and procedural

Reference

Was this guide helpful?

Sunny Arora

Written by

Sunny Arora

Get technical deep dives delivered to your inbox

Join creators and developers who get exclusive insights, tutorials, and behind-the-scenes content every week.

No spam. Unsubscribe anytime.

Continue Exploring

You might also enjoy