What does cubic-bezier() actually control?
It's a four-value function describing the timing curve of a transition or animation: how progress maps from 0 to 100% over the duration. The two control points (P1 and P2) shape the curve. `cubic-bezier(0.42, 0, 0.58, 1)` is the classic "ease-in-out". Sharper curves create snappier motion; flatter curves feel slower and more relaxed. The generator visualizes the curve and previews motion in real time.
How is cubic-bezier different from `ease`, `linear`, etc.?
The named keywords are presets that map to specific cubic-bezier values: `ease` is `cubic-bezier(0.25, 0.1, 0.25, 1)`, `linear` is `cubic-bezier(0, 0, 1, 1)`, etc. They cover common cases but feel generic. Custom cubic-bezier curves give you brand-specific motion personality, like a bouncy product feel or a deliberate, weighty enterprise feel. Reach for custom curves when default easings feel off-the-shelf.
Can a cubic-bezier curve create a bounce or overshoot?
Yes, partly. If a control point's y value goes below 0 or above 1, the curve dips below the start or overshoots the end before settling, producing a small bounce or anticipation effect. Try `cubic-bezier(0.68, -0.55, 0.27, 1.55)` for an overshoot. For multi-bounce effects, you'll need keyframe animation with several stops because cubic-bezier defines a single, monotonic curve segment.
When should I use spring physics instead of cubic-bezier?
Spring animations (via the Web Animations API or libraries like Framer Motion) feel more natural for interactive UI because they react to current velocity rather than following a fixed timeline. Use cubic-bezier for predictable, controlled motion like page transitions and scripted animations. Use springs for drag-release interactions, gestural UIs, and any motion that needs to feel physically responsive.
How do I pick the right curve for my UI?
For entrance animations (something appearing), use a curve that starts fast and decelerates, like `cubic-bezier(0, 0, 0.2, 1)`. For exits, do the opposite: accelerate out with `cubic-bezier(0.4, 0, 1, 1)`. State changes (toggle, hover) feel natural with symmetric ease-in-out. Match curve duration to the distance traveled: 150-250ms for small interactions, 300-500ms for larger transitions.
Are there any browser quirks with custom curves?
cubic-bezier is universally supported in all modern browsers and works identically. The newer `linear()` function for arbitrary multi-stop curves has narrower support but is excellent for spring-like effects when paired with progressive enhancement. Stick with cubic-bezier for cross-browser-safe production code, and feature-detect linear() for optional polish on browsers that support it.