Cubic-Bezier Transition Curve Animator
Drag the control point handles, watch your easing curve update live, and copy the generated CSS timing function instantly.
Click "Trigger Animation" or enable Auto-loop to compare.
/* Loading... */
The Complete Guide to CSS Cubic-Bezier Timing Functions
Every CSS transition you write has a timing function controlling its speed rhythm. By default this is "ease" - but that preset was designed for general use, not your specific animation. Cubic-bezier curves let you define exactly how your element accelerates, decelerates, or even bounces past its destination. This guide explains how the math works, how to read the graph, and when to reach for each technique.
How to Use This Tool
Start by dragging the pink (P1) and indigo (P2) handles on the SVG graph. The curve updates in real time as you drag. Alternatively, type precise values into the number inputs or use the step sliders beside each input. Click "Trigger Animation" to fire a single animation cycle across both tracks so you can compare your custom curve against the selected reference. Enable "Auto-loop" to keep both tracks running continuously for a side-by-side feel evaluation. When satisfied, click "Copy CSS" to grab the generated transition property and paste it directly into your stylesheet.
Reading the Coordinate System
The SVG graph maps time on the horizontal axis (left = 0, right = 1) and animation progress on the vertical axis (bottom = 0, top = 1). A perfectly linear curve would be a straight diagonal. A curve that bows upward near the left means the animation starts fast; bowing upward near the right means it accelerates toward the end. When a control point's Y value drops below 0 or exceeds 1, the graph shows a faint hatched zone - this is the "overshoot" region, where the element will temporarily move beyond its start or end state before settling.
Why X Values Must Stay Between 0 and 1
CSS enforces that P1 X and P2 X remain in the range [0, 1] because the timing function must pass the vertical line test: for every moment in time, there can be only one output value. If X could exceed 1 or go negative, a single timestamp could correspond to two different progress values, which is undefined. The Y axis has no such restriction. Browsers intentionally allow any Y value because the output is a property value, and it makes physical sense for a spring to temporarily overshoot before snapping back.
Choosing the Right Curve for the Job
Ease-out (starts fast, ends slow) is the workhorse for most UI interactions: menus opening, cards appearing, modals sliding in. It feels natural because objects in real life decelerate before stopping. Ease-in (starts slow, ends fast) works for elements leaving the screen - an exit that speeds up feels intentional. Ease-in-out is ideal for elements repositioning within the viewport; the symmetric acceleration and deceleration makes the eye comfortable. Spring curves (with overshoot) add personality and delight to product UIs but should be used sparingly - reserve them for single focal elements, not repeated list items.
Using cubic-bezier in @keyframes
You are not limited to element-level transitions. Inside a @keyframes block, each percentage step can have its own animation-timing-function declaration. For example, setting animation-timing-function: cubic-bezier(0.34,1.56,0.64,1) at the 0% step gives only that phase a spring feel, while later steps can be linear or ease-out. This lets you build complex, choreographed animations with different movement qualities in different phases - a technique used heavily in micro-interaction design.