Overview
TheTransition type defines how animations move from one state to another. It controls timing, easing, animation type, and orchestration of child animations.
Import
Type Definition
Core Properties
Animation Type
The type of animation:
"tween": Duration-based with easing (default)"spring": Physics or duration-based spring"inertia": Decay animation"keyframes": Multi-keyframe animationfalse: Instant (no animation)
Timing
Duration in seconds:
- Default:
0.3for tween - Default:
0.8for keyframes - Springs use calculated duration or custom
duration
Delay before animation starts, in seconds. Default:
0Time already elapsed in the animation, in seconds. Default:
0Easing
Easing function or array of easing functions. Can be:
- Named easing:
"linear","easeIn","easeOut","easeInOut","circIn", etc. - Cubic bezier:
[0.17, 0.67, 0.83, 0.67] - Custom function:
(t: number) => number - Array for keyframes (one per segment)
Array of 0-1 values defining when each keyframe occurs. Must match keyframe count.
Spring Properties
Physics-Based
Spring stiffness. Higher values create more sudden movement.
Strength of opposing force. Set to
0 for infinite oscillation.Mass of the moving object. Higher values result in more lethargic movement.
Duration-Based
For springs, this overrides physics calculations to create a duration-based spring.
Bounciness from 0-1. Only used with duration-based springs. Higher = more bouncy.
Time for the bulk of the transition, with “bouncy” part happening after.
Velocity
Initial velocity of the animation.
End animation if absolute speed drops below this value.
End animation if distance is below this value.
Inertia Properties
Higher power equals further target.
Adjusts duration of deceleration.
Modify automatically-calculated target. Useful for snapping to grid.
Minimum constraint. Value will bounce against this.
Maximum constraint. Value will bounce against this.
Stiffness of bounce spring when hitting min/max.
Damping of bounce spring when hitting min/max.
Repeat Properties
Number of times to repeat. Set to
Infinity for perpetual repeating.How to repeat:
"loop": Restart from beginning"reverse": Alternate between forward and backward"mirror": Switch from and to values
Duration to wait between repeats, in seconds.
Orchestration Properties
Relationship to children:
false: Animate with children simultaneously"beforeChildren": Finish before children start"afterChildren": Start after children finish
Delay before children animations start, in seconds.
Stagger delay between each child, in seconds. ⚠️ Deprecated: use
delayChildren: stagger(interval)Direction of stagger. ⚠️ Deprecated: use
delayChildren: stagger(interval, { from: 'last' })Lifecycle Callbacks
Called every animation frame with the latest animated value.
Called when animation starts playing.
Called when animation completes.
Called each time animation repeats.
Called when animation is manually stopped.
Per-Property Overrides
Define different transitions for specific properties:Default transition for properties without specific overrides.
Transition specifically for layout animations.
Examples
Basic Tween
Spring Animation
Duration-Based Spring
Keyframe Animation
Infinite Loop
Per-Property Transitions
Orchestrating Children
Layout Animation
With Callbacks
Inertia Animation
Type Helpers
ValueAnimationTransition
Base transition type with all options:DynamicOption
Create dynamic values based on element index:Transition Inheritance
Whether this transition should merge with parent transition (shallow merge, inner keys win).
Related Types
AnimationOptions
Full animation options reference
Variants
Variant definitions
Easing
Easing function types
Spring Guide
Spring animation guide