Why Easing Matters
Linear motion feels robotic. Real objects accelerate and decelerate. Easing functions bridge the gap between math and natural movement, making interfaces feel alive.
The Math: De Casteljau's Algorithm
A bezier curve isn't magic—it's recursive linear interpolation. The algorithm finds points along the curve by repeatedly interpolating between control points at a given t value (0 to 1).
- Start with 4 control points (P0, P1, P2, P3)
- Lerp between adjacent pairs at t
- Lerp between those results
- Lerp once more for the final point
The Bezier Curve Editor
A cubic bezier is defined by four points: two fixed endpoints (0,0) and (1,1), plus two control points you can drag. The x-axis is time, y-axis is progress.
cubic-bezier(0.25, 0.10, 0.25, 1.00)The Penner Equations
Robert Penner's easing equations from 2001 became the foundation for motion design. Each family—quad, cubic, quart, expo, sine, circ, back, elastic, bounce—has in, out, and in-out variants.
Easing Families Compared
Quadratic is subtle, exponential is dramatic. Elastic overshoots and oscillates, bounce simulates a ball hitting the ground. Each creates a distinct personality.
cubic-bezier(0.25, 0.1, 0.25, 1)The Easing Playground
See how different easing functions affect real animations. Compare multiple curves side-by-side across position, scale, rotation, and opacity.
Beyond Bezier: Spring Physics
Springs don't follow bezier curves—they simulate real physics with mass, stiffness, and damping. This creates organic motion that can be interrupted mid-flight.
{ type: "spring", stiffness: 100, damping: 10, mass: 1 }Unlike bezier curves which map time to progress, springs simulate real physics. They can be interrupted mid-animation and will naturally continue from their current velocity.
CSS Steps: Discrete Motion
Not all motion is smooth. The steps() function creates frame-by-frame animation—perfect for sprite sheets, typewriter effects, or intentionally choppy motion.
steps(4, jump-end)jump-start: The first step happens immediately at t=0.
Easing in Practice
Different UI patterns call for different easings. Entrances typically ease-out (fast then slow), exits ease-in (slow then fast), and emphasis animations often overshoot.
Respecting User Preferences
Some users experience motion sickness or vestibular disorders. The prefers-reduced-motion media query lets you provide alternatives—essential for accessible motion design.
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}const prefersReduced = window.matchMedia(
'(prefers-reduced-motion: reduce)'
).matches
const transition = prefersReduced
? { duration: 0 }
: { type: 'spring', stiffness: 300 }prefers-reduced-motion is set, replace animations with instant transitions or simple fades. Never remove feedback entirely — users still need to know something happened.