Table of Contents

Struct AnimationSequenceStep

Namespace
Velvet
Assembly
Velvet.Docs.dll

One step in an animation sequence played by UseAnimationSequence(IReadOnlyList<AnimationSequenceStep>, object?[]?, bool, bool). A step is exactly one of: a variant-label change (To(string, StyleTransitionConfig?, float?)), a pure timing gap (Wait(float)), a synchronous C# callback (Call(Action)), or a wait on a task (Await(Func<CancellationToken, VelvetTask>)).

public readonly struct AnimationSequenceStep

Properties

AwaitFactory

The function whose task the step waits on. Non-null only on an Await(Func<CancellationToken, VelvetTask>) step.

Callback

The callback to invoke. Non-null only on a Call(Action) step.

HoldSec

How long the sequence holds on this step before advancing. On a To(string, StyleTransitionConfig?, float?) step, null derives the hold from Transition: DurationSec + DelaySec for Tween or Bezier, and for Spring its DelaySec plus the duration Framer Motion's sequence gives the same spring. A Bezier or Spring Repeat below 20 lengthens that by every pass and the waits between them; the motion guide's Timelines section says what one of 20 or more does. Required on Wait(float) (negative values clamp to 0). Always 0 on Call(Action) and Await(Func<CancellationToken, VelvetTask>).

Label

The variant label to activate. Non-null only on a To(string, StyleTransitionConfig?, float?) step.

Transition

The transition driving this label change. Null means "reuse the most recent non-null transition earlier in the sequence", falling back to StyleTransition's Fade preset (the same default V.Motion itself uses) if none has been set yet. Only meaningful on a To(string, StyleTransitionConfig?, float?) step.

Methods

Await(Func<CancellationToken, VelvetTask>)

Calls taskFactory on arrival and holds the cursor until the task it returns settles — an await between the animations of Framer Motion's useAnimate. A restart, a deps change or unmount that leaves the step with the task still pending cancels the token. The motion guide's Timelines section owns what a settle, a fault and a pause do.

Call(Action)

Fires callback synchronously on arrival, then advances immediately — never holds the cursor. Step 0's callback re-fires under the Editor's StrictMode mount double-invoke diagnostic (same expectation as any UseEffect mount factory with a non-idempotent body), so write it to tolerate running twice if the sequence's own mount matters.

To(string, StyleTransitionConfig?, float?)

Activates label on the sequence's coordinator — feeds straight into V.Motion(animate:, transition:). Descendant Motions naming no label of their own inherit it exactly as they do for any hand-toggled label, including StaggerChildrenSec fan-out when transition declares it — "one at a time" across a list of such descendants needs no separate multi-target API.

Wait(float)

Holds the current label for seconds before advancing. No visual effect of its own.