Skip to main content
Animation constructors create AnimationComponent values that define the timing and feel of state transitions. Pass them to withAnimation or the .animation() modifier.

Spring

A spring animation with response and damping parameters. This is the most common animation type.
response
number
default:"0.55"
Duration of the spring’s settle time in seconds. Lower values produce faster animations.
dampingFraction
number
default:"0.825"
Damping ratio. 0 = no damping (infinite oscillation), 1 = critical damping (no bounce).
blendDuration
number
Duration in seconds for blending between animations.

InterpolatingSpring

A spring animation defined by physical stiffness, damping, and mass for precise control.
stiffness
number
required
Spring stiffness coefficient. Higher values produce faster, stiffer springs.
damping
number
required
Damping coefficient. Higher values produce less bounce.
mass
number
required
Mass of the spring. Higher values produce slower animations with more momentum.

EaseIn

An ease-in timing curve that starts slow and accelerates toward the end.
duration
number
Animation duration in seconds.

EaseInOut

An ease-in-out timing curve that starts and ends slow with acceleration in the middle.
duration
number
Animation duration in seconds.

EaseOut

An ease-out timing curve that starts fast and decelerates toward the end.
duration
number
Animation duration in seconds.

Linear

A linear timing curve with constant speed throughout.
duration
number
Animation duration in seconds.

Bouncy

A spring animation with extra bounce for playful, attention-grabbing effects.
duration
number
Approximate animation duration in seconds.
extraBounce
number
Extra bounce amount. 0 = no extra bounce, 1 = very bouncy.

Snappy

A spring animation with higher damping for a quick, responsive feel.
response
number
Duration of the spring’s settle time in seconds.
dampingFraction
number
Damping ratio. 0 = no damping, 1 = critical damping.
blendDuration
number
Duration in seconds for blending between animations.

Chainable Modifiers

All animation constructors return an AnimationComponent that supports these chainable methods:

delay

Delays the start of the animation.

speed

Multiplies the animation speed.

repeatCount

Repeats the animation a fixed number of times.

repeatForever

Repeats the animation indefinitely.
autoreverses
boolean | { autoreverses: boolean }
If true, the animation reverses direction each cycle. If false, it restarts from the beginning.

Combining modifiers

Notes

  • Default parameter values are platform-specific and optimized for each environment.
  • Spring animations (Spring, InterpolatingSpring, Bouncy, Snappy) may overshoot their target based on damping settings.
  • Timing curve animations (EaseIn, EaseInOut, EaseOut, Linear) run for a fixed duration and do not overshoot.
  • Use repeatForever sparingly to avoid performance issues.

See Also