How to create a custom easing curve
- Start from a preset: the CSS keywords (ease, linear, ease-in, ease-out, ease-in-out) or popular curves such as easeOutCubic, easeOutExpo and easeOutBack.
- Drag the two control points on the graph, or type exact values for x1, y1, x2 and y2.
- Press Play to compare your curve with the default
easeat different durations. - Copy the
cubic-bezier()value for atransitionor ananimation.
How cubic-bezier() works
The horizontal axis is time and the vertical axis is progress. The curve always starts at (0, 0) and ends at (1, 1); the two control points shape what happens in between. The x values must stay between 0 and 1, but y values can go beyond that range, which makes an animation overshoot and come back, like the Back curves.
- Ease out (fast start, slow end) feels responsive. Use it for elements entering the screen, menus and dialogs opening.
- Ease in (slow start, fast end) suits elements leaving the screen.
- Ease in-out works for elements that move from one place to another on screen.
- Linear is best for continuous motion such as spinners and progress bars.
Animation tips
- Keep interface animations short: 150–300ms for small changes, up to 500ms for large panels.
- Animate
transformandopacity; they are cheap for the browser to render. - Respect
prefers-reduced-motionand remove large movements for users who ask for less motion.
In Tailwind CSS, use the value as an arbitrary class: ease-[cubic-bezier(0.34,1.56,0.64,1)].