Cubic-bezier

Also called cubic-bezier(), custom easing curve, or bezier curve easing

A CSS function that defines a custom easing curve with four numbers: the positions of two control points that bend the curve.

What is Cubic-bezier?

cubic-bezier(x1, y1, x2, y2) describes an easing curve that always runs from (0, 0) to (1, 1). The four numbers place two control points that pull the curve into shape: the first shapes the start of the motion and the second shapes the end. The x values must stay between 0 and 1, while the y values can go outside that range.

The CSS keywords ease, ease-in, ease-out, and ease-in-out are all cubic-bezier curves underneath: ease is cubic-bezier(0.25, 0.1, 0.25, 1) and ease-out is cubic-bezier(0, 0, 0.58, 1). Writing your own lets you make motion snappier or softer than the keywords allow, and y values above 1 or below 0 make the motion overshoot or pull back first.

You rarely need to guess the numbers. Chrome and Firefox dev tools open a curve editor when you click the curve icon next to a timing function, and Motion and most other animation libraries accept the same four numbers as an array, such as ease: [0.23, 1, 0.32, 1].

All terms

Easing

A curve that controls how an animation’s speed changes over time, so motion can start slow, land softly, or keep one steady pace.

Ease-out

An easing curve that starts fast and slows down at the end, so motion feels quick and lands softly.

Overshoot easing

An easing curve that runs slightly past its end point and then settles back, giving motion a small, springy kick.

Asymmetric easing

An easing curve whose start and end are shaped differently, such as a quick start with a long, gentle landing.