Table of Contents

Class MotionNode

Namespace
Velvet
Assembly
Velvet.Docs.dll

Element node that participates in animations. A variant Initial/Animate pair plays its mount enter on ANY Motion, standalone or under AnimatePresence; Exit requires AnimatePresence (something must defer the unmount for the removal to animate against) and switches CSS classes on unmount based on the transition definition. Inline styles (StyleOverrides) are intentionally not supported. Apply styles via USS classes.

public sealed class MotionNode : BaseElementNode
Inheritance
object
MotionNode
Inherited Members

Properties

Animate

The active variant label for this node (a key of Variants); null inherits the nearest ancestor Motion's active label.

Exit

Exit variant label. When this Motion is the direct child of an AnimatePresence and sets Exit + Animate + Variants, removal animates from the resting variants[Animate] to variants[Exit] (using the Transition timing) before the element unmounts. Unlike Initial, this genuinely needs AnimatePresence — something must defer the unmount for the removal to animate against — so it is inert (and logs a warning) outside one. Null = use the transition's own ExitFrom/ExitTo classes.

Initial

Mount-time starting variant label. When this Motion sets Initial + Animate + Variants, the enter starts the element at variants[Initial] and transitions to variants[Animate] (which it then rests at, persistently) using the Transition timing. Works the same whether this Motion is the direct child of an AnimatePresence or mounts standalone — Framer parity: initial/animate apply to any motion.* component; AnimatePresence is only required for Exit. Null = no variant initial state.

OnEnterComplete

Callback invoked when the enter animation completes. Fires for a variant Initial/Animate enter whether this Motion sits under AnimatePresence or mounts standalone. Invoked immediately when StyleTransitionConfig.None. When initial=false, fires synchronously inside CreateElement. On asynchronous animation completion via schedule.Execute, called outside of Reconcile, so SetState() is safe.

Transition

Transition configuration.

Variants

Named animation states: each label maps to a utility-class string. Carried RAW (never baked into ClassNames): the effective label is resolved at reconcile time — this node's Animate, else the nearest ANCESTOR Motion's active label (parent→child propagation) — and applied against these variants.