Animation in digital interfaces has evolved from fixed timelines to dynamic physical modeling. Understanding when to use duration curves versus spring physics is fundamental to crafting high-craft interactive software.
How duration-based animations work
A duration-based animation specifies a fixed time window (e.g., `transition: transform 250ms ease-out`). Regardless of how far the element travels or how fast the user was moving their finger, the animation must complete in exactly 250ms.
If the user taps or drags the element while it is halfway through that transition, a duration-based system must either cancel the animation abruptly or reset from zero, creating visual stutter and broken momentum.
How spring physics work
Spring kinematics calculate an element’s acceleration, velocity, and position frame-by-frame based on harmonic oscillation physics:
- **Stiffness:** How strong the pull toward the target is (higher stiffness = faster snap).
- **Damping:** How much friction resists the motion (lower damping = bouncy overshoot; critical damping = smooth stop with zero bounce).
- **Mass:** How heavy the object feels (higher mass = slower start and greater inertia).
Because springs calculate velocity dynamically, they naturally inherit user gesture speed. If a user flicks a bottom sheet downward with high velocity, a spring-driven sheet accelerates smoothly into place without snapping.
When to use which in interactive UI
- **Use Spring Physics for:** Draggable elements, modal sheets, button click squash-and-stretch, toggle switches, and anything directly manipulated by a pointer or finger.
- **Use Duration Curves for:** Pure color fades, background opacity cross-fades, and fixed linear progress bars.
In ExodeUI, which we make, you can rig true spring kinematics directly on layer transforms without mathematical guesswork, generating clean spring tokens for production runtimes.