Cubic-Bezier Easing Editor
Interactively adjust cubic-bezier transition curves and preview real-time motion physics against standard timing functions.
Unlike conventional calculator sites that send your financial numbers, payload data, or code snippets across remote web servers, Affi-Chain processes all mathematical derivations, algorithms, and data parsing 100% locally within your browser sandbox. No tracking cookies, no server-side retention, and zero transmission lag.
What is a CSS Cubic-Bézier Curve?
In web animation and interface design, a Cubic-Bézier Curve is a parametric mathematical function used to define the acceleration and deceleration rate of a transition or keyframe animation over time. Standardized under the W3C CSS Easing Functions Level 1 specification, Bézier curves dictate how the speed of an animation evolves from its initial starting state ($t = 0$) to its terminal state ($t = 1$).
Named after the French mathematician and automotive engineer Pierre Bézier, who pioneered their usage at Renault in the 1960s to design vehicle body geometry, Bézier curves form the mathematical backbone of modern digital motion graphics, CAD vector modeling, font rendering engines, and CSS motion frameworks.
Rather than moving an element at a constant, robotic velocity (linear), real-world physical objects possess mass, friction, and inertia. A car accelerates smoothly before reaching cruise velocity, and a falling object decelerates as it compresses upon impact. The Affi-Chain Cubic-Bézier Curve Generator enables frontend developers and UX motion designers to visually sculpt custom timing curves, test real-time physics benchmarks, and export clean CSS, Tailwind, and Web Animations API (WAAPI) timing functions.
The Mathematical Foundation: 4-Point Parametric Formulation
In CSS, a cubic Bézier curve is bounded within a unit coordinate box where the horizontal axis ($X$) represents Time elapsed ($0$ to $100%$) and the vertical axis ($Y$) represents Progression / Property value completed ($0$ to $100%$).
A cubic curve is formally evaluated using the third-order Bernstein polynomial equation:
$$B(t) = (1 - t)^3 P_0 + 3(1 - t)^2 t P_1 + 3(1 - t) t^2 P_2 + t^3 P_3, \quad t \in [0, 1]$$
The Four Coordinate Control Points:
- $P_0 = (0, 0)$: The fixed starting anchor (time $0$, property value $0$).
- $P_1 = (x_1, y_1)$: The first dynamic control handle that determines the initial departure trajectory.
- $P_2 = (x_2, y_2)$: The second dynamic control handle that determines the terminal arrival velocity.
- $P_3 = (1, 1)$: The fixed terminal anchor (time $1$, property value $1$).
Because $P_0$ and $P_3$ are immutable constants, CSS exposes only the two middle control points via the functional notation:
$$\text{transition-timing-function: } \mathbf{\text{cubic-bezier}(x_1, y_1, x_2, y_2)};$$
Standard CSS Easing Keywords vs. Custom Curves
CSS provides several built-in keywords that act as aliases for pre-configured cubic-bezier coordinates:
| Easing Keyword | Equivalent Bézier Syntax | Acceleration Profile | Best Visual Application |
|---|---|---|---|
linear | cubic-bezier(0, 0, 1, 1) | Zero acceleration; constant robotic speed. | Audio volume sliders, infinite looping spinners. |
ease | cubic-bezier(0.25, 0.1, 0.25, 1) | Default CSS ease; slow start, rapid middle, subtle slow finish. | General UI element state changes. |
ease-in | cubic-bezier(0.42, 0, 1, 1) | Gradual start that accelerates continuously until an abrupt stop. | Elements exiting the viewport off-screen (e.g. dismissing a toast). |
ease-out | cubic-bezier(0, 0, 0.58, 1) | Explosive initial burst that decelerates smoothly into place. | Elements entering the viewport from off-screen (e.g. modals, drawer slide-ins). |
ease-in-out | cubic-bezier(0.42, 0, 0.58, 1) | Symmetrical slow departure, rapid travel, and gradual arrival. | Repositioning elements across the screen without exiting. |
Production-Ready High-Performance Motion Presets
Modern high-end user interfaces (such as Apple’s iOS system transitions, Stripe’s checkout modals, and Vercel’s interactive cards) rarely use the default ease. Instead, they rely on custom curves characterized by steep initial slopes and extended deceleration tails:
1. Snappy Deceleration (The Modern Modal & Drawer Curve)
Explodes onto the screen with immediate momentum and glides smoothly into place without bouncing:
.modal-enter {
transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
2. Elastic Spring Overshoot ($y > 1.0$)
By extending the vertical coordinate $y_2$ beyond $1.0$, the element overshoots its target destination before snapping back, replicating a mechanical spring:
.button-pop {
transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
3. Anticipatory Wind-Up ($y < 0.0$)
By pulling $y_1$ below $0.0$, the element pulls backwards slightly before launching forward, creating an engaging cartoon-style anticipation:
.card-launch {
transition: transform 0.5s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}
Technical Comparison: Cubic-Bezier vs. JavaScript Springs vs. Steps
| Dimension | CSS Cubic-Bezier | JavaScript Physics Springs (Framer Motion) | CSS steps() |
|---|---|---|---|
| Execution Layer | Browser Compositor Thread (GPU). 100% hardware-accelerated. | Main Thread (CPU calculation per requestAnimationFrame). | Compositor Thread. |
| Frame Stability | Zero Jitter. Never drops frames even if JavaScript main thread is blocked. | Can stutter or drop frames if heavy React re-renders occur during animation. | Zero Jitter. |
| Interactivity | Rigid pre-calculated duration; cannot dynamically interrupt mid-flight with velocity. | True physical velocity transfer upon gesture release. | Discontinuous jumps. |
| Bundle Cost | 0 Kilobytes (Pure native CSS). | 30KB – 60KB runtime library bundle. | 0 Kilobytes. |
Critical Edge Cases & Common Developer Pitfalls
When authoring custom Bézier curves, developers frequently encounter strict mathematical constraints and rendering artifacts:
1. The Strict Time Domain Rule ($0 \le X \le 1$)
- The Law of Time: In physics and CSS, time cannot flow backwards.
- The Constraint: Both $x_1$ and $x_2$ must strictly reside within the range $[0, 1]$.
- The Bug: If you attempt to write
cubic-bezier(-0.2, 0.5, 1.2, 1), the browser’s CSS parser will reject the entire rule as invalid syntax, silently dropping back to standardeaseorlinear! - Vertical Freedom: Unlike the $X$-axis, the $Y$-axis coordinates ($y_1$ and $y_2$) have no upper or lower bounds. Setting $y_2 = 1.7$ is entirely valid and produces elastic overshoot.
2. The overflow: hidden Clipping Trap on Spring Overshoots
- When applying elastic curves with $y > 1.0$ to scaling animations (
transform: scale(1.15)), the element will momentarily expand beyond its natural container boundaries. - The Problem: If any parent ancestor element has
overflow: hidden, the spring overshoot will be abruptly clipped off at the container edge, producing an ugly graphical cutoff instead of a smooth spring. - The Fix: Ensure parent containers allow sufficient padding or omit
overflow: hiddenon animated card wrappers.
3. Animating Non-Composited Properties
- Never use custom cubic-bezier curves on properties that trigger layout recalculation or painting (such as
width,height,top,margin, orpadding). - The 120Hz Rule: Strictly animate
transform(translate3d,scale,rotate) andopacity. These two properties are handled directly by the graphics chip (GPU) without triggering CPU reflows.