CASpringAnimation receives damping, stiffness, and mass directly. On Android, SpringAnimation derives its damping ratio from these values using: dampingRatio = damping / (2 * sqrt(stiffness * mass)).
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
type | 'spring' | — | Selects spring animation |
damping | number | 15 | Friction — higher values reduce oscillation and bounce |
stiffness | number | 120 | Spring constant — higher values mean a faster, snappier animation |
mass | number | 1 | Mass of the object — higher values mean slower motion with more momentum |
delay | number | 0 | Delay in milliseconds before the animation starts |
Parameter intuition
dampingcontrols how quickly oscillation dies out. A low damping value (e.g.8) produces noticeable bounce; a high value (e.g.20) reaches the target without overshoot.stiffnesscontrols the speed of the animation. Higher stiffness means the spring pulls harder and the animation completes faster.massadds inertia. Heavier objects take longer to accelerate and decelerate, producing a weighty feel.
Spring Presets
These presets cover the most common animation feels:Example
Spring animations do not support the
loop option. Use a timing animation with loop: 'repeat' or loop: 'reverse' for looping effects.On Android, the damping ratio passed to
SpringAnimation is derived from damping, stiffness, and mass using the formula damping / (2 * sqrt(stiffness * mass)). The three parameters are not passed to Android directly, but the resulting motion closely matches iOS for typical values.