Class StyleTransitionConfig
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
CSS-transition-based animation configuration for V.Motion. Drives a USS class swap
(enter-from → enter-to / exit-from → exit-to); DurationSec / Easing are
applied as inline styles. Use the presets on StyleTransition, optionally tuned via
With(float?, EasingMode?, EasingMode?, float?).
public sealed class StyleTransitionConfig
- Inheritance
-
objectStyleTransitionConfig
Fields
- None
Sentinel value indicating "no transition":
V.Motion(transition: StyleTransitionConfig.None)requests immediate mount/unmount with no animation.
Properties
- Damping
Spring damping (only meaningful when Type is Spring). Higher values settle with less oscillation. Framer Motion's default (10).
- DelayChildrenSec
A fixed delay (seconds) added before any inheriting descendant's staggered delay — see StaggerChildrenSec for the full propagation contract. 0 (default) means no fixed delay.
- DelaySec
Animation start delay (seconds). Applied as the inline CSS transition-delay style. Foundation for stagger (sequentially delayed animations). 0 means no delay (default). Negative values are ignored (transition-delay is not set; behaves as no delay). Note: currently a single delay shared between enter and exit. If a separate exit delay is needed, consider adding ExitDelaySec.
- DurationSec
Animation duration (seconds). Applied as the inline transition-duration style. Ignored when Type is Spring: a spring's settle time is decided entirely by Stiffness / Damping / Mass, not a fixed duration.
- Easing
Easing mode. Applied as the inline transition-timing-function style. Defaults to EaseOut (for enter). Presets in StyleTransition.cs configure enter/exit easing separately. Ignored when Type is Spring: the physics integration IS the curve.
- ExitEasing
Easing mode for exit. When null, Easing is reused. The presets in StyleTransition.cs typically use EaseOut for enter and EaseIn for exit.
- Mass
Spring mass (only meaningful when Type is Spring). Higher values feel heavier / slower to accelerate. Framer Motion's default (1).
- PropertyOverrides
Optional per-property transition overrides layered on top of the top-level DurationSec / Easing / DelaySec (e.g. opacity tweening in 0.15s while scale takes 0.5s). When set, transition-property switches from the implicit "all" catch-all — used for a variant class swap, which carries no transition-* of its own — to EXACTLY these properties, in declaration order: overrides REPLACE transition-property: all rather than layering on top of it, matching CSS semantics where an explicit transition-property list transitions only what it names. Name every property that should animate. Currently wired only where a variant swap would otherwise set transition-property: all (a variant-driven enter, or an exit driven by a
variants+exitlabel) — a preset transition's own USS-declared transition-property is untouched. Null (default) preserves today's behavior unchanged. Not read when Type is Spring: a spring drives every animated channel with the SAME Stiffness / Damping / Mass — there is no per-property override of the spring model itself (only Tween's per-property duration/easing/delay can be overridden this way).
- StaggerChildrenSec
Delay interval (seconds) applied sequentially to each DESCENDANT Motion that inherits its active label from this Motion (it declares
variantsbut no ownanimate— see Animate) when that ambient label changes: the i-th such inheriting descendant, visited in document order, is delayed an additionalDelayChildrenSec + StaggerChildrenSec- i on top of its OWN DelaySec. 0 (default) means no stagger (every inheriting
descendant responds at the same time). Unlike AnimatePresence's own per-child enter/exit stagger
(
V.AnimatePresence(staggerSec:)), this orchestrates a PLAIN parent → child label propagation — no AnimatePresence boundary is required; toggling this Motion'sanimateprop is enough. A descendant with its OWN explicitanimateopts out of both the label inheritance and this stagger — it is driven by its own render, not this propagation (matching Framer Motion, where an explicitanimateoverride disconnects a component from its parent's variant propagation). The stagger index is transitive: an inheriting descendant with no stagger config of its own passes this orchestration through to ITS OWN inheriting children, who continue claiming from the SAME sequence.
- i on top of its OWN DelaySec. 0 (default) means no stagger (every inheriting
descendant responds at the same time). Unlike AnimatePresence's own per-child enter/exit stagger
(
- Stiffness
Spring stiffness (only meaningful when Type is Spring). Higher values snap toward the target faster. Framer Motion's default (100).
- Type
Selects the animation model: a USS
transition-*class swap (Tween, the default) or a physics-integrated spring (Spring). See TransitionType for the full contract, including what a spring does and does not animate.
- When
Sequences this Motion's own class swap against its inheriting descendants' swaps (see StaggerChildrenSec) when its active label changes. Defaults to Together.
Methods
- With(float?, EasingMode?, EasingMode?, float?)
Builds a new StyleTransitionConfig that overrides duration / easing on top of the preset. Class-name definitions are copied; only the specified parameters are overridden.