Table of Contents

Class AnimatePresenceNode

Namespace
Velvet
Assembly
Velvet.Docs.dll

Container node that manages mount / unmount animations of its children. When keyed children become null, it does not delete them immediately and retains them until the exit animation completes. A keyed child is kept while the exits of the Motions under it play, however deep they sit; the Exits section of Documentation~/motion.md owns which Motions play one. A keyed FragmentNode is accepted as a child: its first Motion is the child's anchor and every element it places stays until the exits of its Motions finish. Children without a key receive a position-based automatic key, so reordering can cause unintended exit / enter animations. Set explicit keys on children that participate in animation.

public sealed class AnimatePresenceNode : VNode
Inheritance
object
AnimatePresenceNode
Inherited Members

Properties

Children

Array of child nodes. May include MotionNode. Null children are treated as removed.

DelayChildrenSec

A fixed delay (seconds) added before ANY child animates. Combined with the per-child stagger: child i is delayed by DelayChildrenSec + StaggerSec * staggerIndex(i).

Initial

When false, the enter animation on initial mount is skipped. Defaults to true (animate on initial mount as well).

Mode

Exit / enter sequencing. Defaults to Sync (exit and enter overlap). Wait renders only the exiting children until in-flight exits finish. PopLayout pulls an exiting child out of flow so siblings reflow around it immediately.

OnExitComplete

Invoked once when every in-flight exit has completed (the exiting set empties), an exit with nothing to animate after the commit that removed its child. Not fired when an exit is cancelled by the key re-entering.

Propagate

Set on an inner presence, after Framer's propagate: while the enclosing presence's keyed child holding this one is leaving, this presence treats every one of its own children as not present, plays their exits through its own exit path, and the enclosing presence keeps that child mounted until they have completed. OnExitComplete runs when this presence's own exits finish. The nearest enclosing presence decides, so one between the two that does not propagate stops it. When false (default), this presence's children are left as they are when the enclosing presence removes the child.

StaggerDirection

Direction the stagger sweeps. 1 (default) staggers first-to-last; -1 staggers last-to-first (the last child animates first).

StaggerSec

Delay interval (seconds) applied sequentially to children's enter animations. The i-th child receives an additional delay of StaggerSec * i. 0 (default) means no stagger (all children start animating simultaneously).

Methods

StaggerDelaySec(int, int)

The total additional delay for the child at index of count siblings: DelayChildrenSec plus the stagger offset, swept per StaggerDirection.