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.Duration of the spring’s settle time in seconds. Lower values produce faster animations.
Damping ratio. 0 = no damping (infinite oscillation), 1 = critical damping (no bounce).
Duration in seconds for blending between animations.
InterpolatingSpring
A spring animation defined by physical stiffness, damping, and mass for precise control.Spring stiffness coefficient. Higher values produce faster, stiffer springs.
Damping coefficient. Higher values produce less bounce.
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.Animation duration in seconds.
EaseInOut
An ease-in-out timing curve that starts and ends slow with acceleration in the middle.Animation duration in seconds.
EaseOut
An ease-out timing curve that starts fast and decelerates toward the end.Animation duration in seconds.
Linear
A linear timing curve with constant speed throughout.Animation duration in seconds.
Bouncy
A spring animation with extra bounce for playful, attention-grabbing effects.Approximate animation duration in seconds.
Extra bounce amount. 0 = no extra bounce, 1 = very bouncy.
Snappy
A spring animation with higher damping for a quick, responsive feel.Duration of the spring’s settle time in seconds.
Damping ratio. 0 = no damping, 1 = critical damping.
Duration in seconds for blending between animations.
Chainable Modifiers
All animation constructors return anAnimationComponent 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.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
repeatForeversparingly to avoid performance issues.
See Also
- withAnimation — wrap state changes with animation