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). A node naming none of this, Initial and Exit inherits the nearest ancestor Motion's labels.

EnterOnMount

Whether this Motion plays its mount enter. False mounts it, and every Motion below it, at its resting pose with no enter, as Framer Motion's initial={false} does. A Motion naming no Initial label otherwise enters from the look it has without its variant classes to the Animate pose.

Exit

Exit variant label. When the keyed AnimatePresence child this Motion sits in, however deep, is removed, the Motion animates from its resting pose to variants[Exit] before the child unmounts, on the timing Transition resolves, whether or not variants[Exit] applies a class (see ClassName), and hands the label down to the Motions inheriting its labels. A label Variants has no pose for plays the classic exit instead. Unlike Initial, this genuinely needs AnimatePresence — something must defer the unmount for the removal to animate against — so it is inert outside one, which a warning reports where the mounted tree holds no AnimatePresence at all. 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); with no Animate it rests at variants[Initial]. Transition resolves the timing. The motion guide's Enter on mount section owns who plays the enter and when a presence withholds it — initial/animate apply to any Motion node; AnimatePresence is only required for Exit. Null = no variant initial state.

LayoutId

Shared-element layout animation identity. When a Motion carrying this same string patches at a resolved layout rect (position and/or size) different from the rect the SAME id last settled at — including a different physical element entirely, e.g. after a same-key type flip or a move to a different parent — it tweens from the old rect to the new one (FLIP: capture the old rect, let layout settle at the new one, apply an inverse transform, then carry that inverse back to zero on the layout transition) instead of jump-cutting. Independent of Variants/ Animate: a layoutId tween runs from the ACTUAL rect delta, not a class-defined from/to pair. Null = no layout animation (ordinary jump-cut on a rect change, matching every other element). Several Motions may hold one id at once: the one that took it last leads, and the others are drawn over it while it moves from one of their boxes, fading out as it crossfades, and hidden otherwise; when the lead leaves, the holder of those left that took the id most recently leads in its place, tweening from the lead's box.

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, and also synchronously inside Reconcile when the enter animation is skipped entirely (a presence-suppressed first mount, or a variant Motion with no resolvable initial state). On asynchronous animation completion via schedule.Execute, called outside of Reconcile, so SetState() is safe.

Transition

Transition configuration. A variant naming its own Transition replaces it for swaps into that pose; a LayoutId tween reads this one either way, a rect delta being no swap into a pose.

Variants

Named animation states: each label maps to a MotionVariant — a utility-class string and, optionally, the transition a swap into that pose plays on in place of Transition. Carried RAW (never baked into ClassNames): the effective label is resolved at reconcile time — this node's own labels, else, when it names none, the nearest ANCESTOR Motion's active label (parent→child propagation) — and applied against these variants.