Snappy spring
Physics instead of a fixed curve: stiffness pulls toward the target, damping bleeds energy off, mass adds inertia. Duration falls out of the physics. A spring has no fixed ease direction: it leaves at the speed the physics gives it and settles with as much bounce as its damping allows.
Code
No cubic bezier can draw this curve. CSS linear() follows it with 21 points; the other tabs use each platform's native equivalent.
/* Exact curve (all modern browsers): */
transition: transform 400ms linear(0, 0.007 1.5%, 0.026 3%, 0.058 4.7%, 0.108 6.7%, 0.212 10%, 0.45 16.8%, 0.555 20%, 0.655 23.3%, 0.738 26.5%, 0.805 29.5%, 0.864 32.7%, 0.914 36%, 0.953 39.3%, 0.984 43%, 1.005 46.8%, 1.02 51%, 1.027 55.8%, 1.027 63.8%, 1.009 84.3%, 1);Exact CSS
linear() draws any curve with straight segments. This one uses 21 points chosen so the motion never strays more than 0.25 % from the real springSnappy; every current browser supports it.
linear(0, 0.007 1.5%, 0.026 3%, 0.058 4.7%, 0.108 6.7%, 0.212 10%, 0.45 16.8%, 0.555 20%, 0.655 23.3%, 0.738 26.5%, 0.805 29.5%, 0.864 32.7%, 0.914 36%, 0.953 39.3%, 0.984 43%, 1.005 46.8%, 1.02 51%, 1.027 55.8%, 1.027 63.8%, 1.009 84.3%, 1)
Questions
How do I write this spring in CSS?
CSS has no spring timing function, so use linear() with the points on this page (21 points, within 0.25 % of the physics). Set the transition to about 0.40 s, the time this spring takes to settle.
When should I use springSnappy?
Interactive and responsive motion — drags, toggles, sheets — and any move that should feel alive. Interruptible in real UI. A spring has no fixed ease direction: it leaves at the speed the physics gives it and settles with as much bounce as its damping allows.
How much does springSnappy overshoot?
It passes the target by 2.8 % of the distance before settling — about 6 px on a 200 px move.
Other springs
Animate with springSnappy in Kineform
Pick it from any key, text animator or camera move, or bend it in the graph editor — on a real-time engine with 3D, light, type and video.