Overview
TheAnimationOptions type defines configuration options for animations in Motion. It provides control over timing, easing, orchestration, and more.
Import
Type Definition
Core Options
Timing
Total duration of the animation in seconds.
Delay before animation starts in seconds. Can be a function for staggered animations.
Duration of time already elapsed in the animation.
Easing
Easing function or array of easing functions for keyframe animations.
Array of numbers between 0 and 1 defining when each keyframe occurs. Must match keyframe count.
Animation Type
Type of animation:
"tween": Duration-based with easing"spring": Physics or duration-based spring"inertia": Decay animation"keyframes": Multi-keyframe animationfalse: Instant (no animation)
Repeat Options
Number of times to repeat. Set to
Infinity for infinite loops.How to repeat the animation:
"loop": Restart from beginning"reverse": Alternate direction each time"mirror": Swap from/to values each time
Delay between repeats in seconds.
Spring Options
Whentype: "spring":
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.
Bounciness of the spring (0-1). Used with
duration for intuitive spring configuration.Time for the visual bulk of the animation to complete. The spring will “bounce” after this.
Initial velocity of the animation.
End animation if speed drops below this value.
End animation if distance is below this value.
Inertia Options
Whentype: "inertia":
Higher power equals further target.
Affects duration of deceleration.
Function to modify the automatically-calculated target. Useful for snapping.
Minimum constraint. Value will bounce against this.
Maximum constraint. Value will bounce against this.
Stiffness of bounce spring when hitting constraints.
Damping of bounce spring when hitting constraints.
Orchestration Options
When to animate relative to children:
false: Animate with children"beforeChildren": Finish before children start"afterChildren": Start after children finish
Delay before starting child animations.
Stagger delay between child animations (deprecated: use
delayChildren: stagger()).Direction of stagger (deprecated: use
delayChildren: stagger(interval, { from: 'last' })).Lifecycle Callbacks
Called on every animation frame with the latest value.
Called when animation starts playing.
Called when animation completes.
Called each time animation repeats.
Called when animation is stopped.
Accessibility
Whether to reduce motion for this animation:
true: Skip transform/layout animationsfalse: Always animateundefined: Use device preference (default)
Per-Property Transitions
Define different transitions for specific properties:Examples
Basic Tween
Spring Animation
Duration-Based Spring
Keyframe Animation
Repeat Animation
With Callbacks
Staggered Children
Inertia Animation
Per-Property Transitions
Reduced Motion
Dynamic Delay
Helper Types
DynamicOption
Create values based on index:ValueTransition
Base transition configuration:Related Types
Transition
Transition type reference
SpringOptions
Spring animation options
InertiaOptions
Inertia animation options
Easing
Easing function types