Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 4 min read

Why Your 300ms Cubic-Bezier Feels Dead (And What Springs Do Differently)

Every product has one. transition: all 300ms ease-in-out. It is the reason a lot of interfaces feel like they are made of cardboard. This is not a taste argument. There is a mechanical reason a fixed-duration curve feel

Every product has one. transition: all 300ms ease-in-out. It is the reason a lot of interfaces feel like they are made of cardboard.

This is not a taste argument. There is a mechanical reason a fixed-duration curve feels wrong for interaction, and a specific set of cases where it is still exactly right.

A curve is a script; a spring is a physics system

A cubic-bezier transition says: over exactly 300ms, move from A to B following this shape. It is a script with a fixed ending.

The problem appears when the user interrupts it. Click a toggle, then click it back at 150ms. What should happen?

With a fixed transition, the browser usually restarts the curve from wherever it is, with a full 300ms duration again. The object visibly hesitates. If you interrupt repeatedly, you get a stuttering object that is clearly not obeying anything.

A spring has no duration. It has a target and a state β€” position and velocity. When the target changes mid-flight, the object keeps its current velocity and accelerates toward the new target. Reversing direction feels like reversing a physical object because that is what is being simulated.

That is the whole difference, and it is why springs feel "alive" and fixed tweens feel like slides.

The math, without the ceremony

A damped spring is a second-order system:

mΒ·x'' + cΒ·x' + kΒ·x = 0

where m is mass, c is damping, k is stiffness, and x is displacement from the target. The behaviour is governed by the damping ratio:

΢ = c / (2·√(k·m))
  • ΞΆ < 1 β€” underdamped, overshoots and settles. This is "bouncy".
  • ΞΆ = 1 β€” critically damped, fastest approach with no overshoot.
  • ΞΆ > 1 β€” overdamped, sluggish, no overshoot.

A concrete implementation, if you want to feel the difference in a CodePen:

function stepSpring(
  state: { x: number; v: number },
  target: number,
  { stiffness: k, damping: c, mass: m, dt }: Params
) {
  const force = -k * (state.x - target) - c * state.v;
  const accel = force / m;
  const v = state.v + accel * dt;
  return { x: state.x + v * dt, v };
}

Integrate at a fixed timestep, not per frame, or the motion changes with the refresh rate. That detail is where most hand-rolled springs go wrong.

Tuning it like a human

Numbers that produce good UI, in the units most spring libraries use:

Feel Stiffness Damping Mass
Snappy button / badge 240 22 1.0
Card or modal entrance 120 18 1.2
Playful metric reveal 180 14 1.0
Heavy panel, no bounce 90 26 1.4

These are in the same family as the values in React Spring and Framer Motion, which is a useful sanity check if you are porting a component.

The practical rule: more damping for things that carry information, less for things that celebrate. A price change should not bounce twice; a success checkmark can.

Where curves win

I am not going to pretend springs are universally correct. There are three cases where a curve is better.

1. Choreographed sequences. A 12-step launch animation with precise holds and overlaps needs a timeline. A spring cannot express "hold for 400ms then move". Use curves and keyframes.

2. Exit animations tied to a deadline. If a toast must be gone in 200ms because a modal is opening under it, a fixed duration is a feature, not a limitation.

3. Non-spatial property changes. Opacity, colour and blur do not have momentum. A spring on opacity looks like a bug. Use a short curve β€” 120–180ms, ease-out β€” and be done.

There is also the accessibility case: prefers-reduced-motion should replace spatial springs with instant or short fades. Springs make that easy if the runtime supports it, but you have to actually wire it up.

Why design tools struggle with this

Here is the part that connects to tooling.

A spring is not a keyframe. There is no "end time" to place on a timeline, because the end depends on the physics. Tools built around timelines therefore tend to approximate springs β€” they bake a 500ms curve that looks like a spring for one specific distance, then ship it. Move the object twice as far and the easing is wrong, because a real spring's duration scales with distance.

That is why "we support springs" in a design tool often means "we have a spring-shaped bezier preset". It is fine for playback. It falls apart the moment the object travels a different distance, or gets interrupted.

An environment that stores stiffness/damping/mass as values, and integrates them at runtime, does not have that problem. The design file and the shipped behaviour are the same simulation. That is the argument for a physics-first format, and it is testable: interrupt the animation on the canvas and in the exported component and see whether they behave the same.

A 30-second audit of your own UI

Open your product. Do these three things:

  1. Rapidly toggle a switch five times. Does it keep its momentum, or hesitate?
  2. Open and close a modal before it finishes appearing. Does it reverse smoothly?
  3. Slow your network to 3G and trigger a state change. Does the motion still make sense when it arrives late?

If any of those feel wrong, the issue is almost never the easing curve. It is that the motion was scripted instead of simulated.

The one-line summary

Use springs for anything the user can interrupt. Use curves for anything that is choreographed, non-spatial, or on a deadline. Never use transition: all β€” that is not a motion decision, it is an accident.

UX Baba writes about interaction design. Exode stores springs as physics parameters rather than baked curves; the free tier at exodeui.com is enough to feel the difference.

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.