Table of Contents

Struct AnimationSequenceStep

Namespace
Velvet
Assembly
Velvet.Docs.dll

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

public readonly struct AnimationSequenceStep

Properties

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, both fixed-duration); a Spring-typed To(string, StyleTransitionConfig?, float?) step with no explicit hold logs a warning and falls back to a fixed estimate, since a spring's settle time is physics-derived and not statically knowable (matches StyleTransitionConfig's own documented "DurationSec is ignored for Spring" contract). Required on Wait(float) (negative values clamp to 0). Always 0 on Call(Action).

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

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 with no own animate 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.