A CSS cubic-bezier bounce is a timing curve that uses a y control value above 1 to create overshoot before settling at the final value.
That technique suits a transition that briefly travels past its destination and returns, such as a button lifting on hover. It is not, by itself, a full multi-bounce animation: a cubic-bezier maps timing between two states, while repeated rises and rebounds are normally defined with keyframes or a spring-based animation system.
CSS has no standard bounce keyword among its five common easing presets. The practical workflow is to build a valid curve, inspect sampled progress, preview its motion, copy the complete timing-function declaration, and test it in the final interface. This guide concentrates on the one-overshoot effect cubic-bezier can produce and shows when a keyframe sequence is the better answer.

Understand the Four Bounce Controls
Every CSS cubic-bezier timing function begins at progress point (0, 0) and ends at (1, 1). The x axis represents input progress—how much of the transition's duration has elapsed—while the y axis represents output progress—the value used by the animated property. The four editable numbers locate two intermediate control points along that curve.
| Coordinate | What it controls | Tool input range | Effect on a bounce-like curve |
|---|---|---|---|
| x1 | Input-time position of the first control point | 0 to 1 | Moves the first part of the timing response in time |
| y1 | Output progress at the first control point | -10 to 10, finite | Above 1 can create early overshoot; below 0 can create anticipation |
| x2 | Input-time position of the second control point | 0 to 1 | Changes how the remaining timing control is distributed |
| y2 | Output progress at the second control point | -10 to 10, finite | Shapes the final approach and can contribute to late overshoot |
The x-coordinate restriction is a CSS validity rule, not a visual preference. If either x1 or x2 falls outside the inclusive zero-to-one range, the timing function is invalid. The generator constrains those fields to the valid range and independently validates the calculation. Its y fields accept finite values from minus ten through ten, leaving room for both anticipation and positive overshoot.
A y value above 1 can make output progress exceed its endpoint before returning to one. A negative y value can make progress dip below zero before moving forward. The perceived result still depends on the animated property, travel distance, and duration. The W3C CSS Easing Functions Level 1 specification defines the syntax, keyword mappings, and x-coordinate rule, while the MDN cubic-bezier() reference documents browser-oriented examples.
Match the Curve to the Motion
Start by deciding what the motion should communicate. A bounce is not automatically better than a standard ease: excessive overshoot can make an interface feel unstable, expose content that was meant to stay hidden, or reverse direction at an awkward moment.
| Desired result | Suitable approach | Reason |
|---|---|---|
| Smooth change without overshoot | Standard easing preset | Provides a familiar, controlled progression |
| One soft overshoot | Positive y control within the accepted range | Output progress can pass the endpoint before settling |
| Anticipation before forward motion | Negative y control within the accepted range | Output progress briefly moves below its starting point |
| Several distinct rebounds | CSS keyframes | A single timing function does not define the intermediate bounce track |
| Velocity-responsive spring | Spring-oriented animation system | A cubic-bezier does not model physical velocity or interruption |
The keyword buttons load the standardized ease, ease-in, ease-out, ease-in-out, and linear equivalents defined by CSS Easing Functions Level 1. They do not leave a hidden keyword in the output: the visible declaration always exposes all four control numbers, making values easier to compare and modify. For a css cubic bezier bounce, start with a modest positive y value and judge it through the graph and moving preview rather than assuming that a large overshoot will feel better.
The graph maintains a stable zero-to-one frame for comparison, so an extreme curve can extend outside the visible square. The sample table and animated preview still use the actual computed easing. Inspect those outputs directly rather than assuming that a curve leaving the chart frame has been clamped.
Create and Test the Timing Function
- Open the CSS Cubic Bezier Generator. Choose a standard preset or enter x1, y1, x2, and y2. For the single-overshoot example in this article, use x1 = 0.34, y1 = 1.56, x2 = 0.64, and y2 = 1. The interface constrains both x inputs to zero through one, accepts finite y inputs from minus ten through ten, and independently validates the calculation.
- Review the graph and numeric progress samples. The table reports output progress at input progress values of 0, 0.25, 0.5, 0.75, and 1. A sample above 1 confirms that the output overshoots at that point in the transition.
- Select Run preview. The preview moves a circle between two horizontal positions using a 900-millisecond transform transition and the exact generated easing. Repeated clicks let you compare forward and reverse motion. Treat this as a timing demonstration rather than a production performance test.
- Copy the complete CSS declaration after the curve looks right. The copied result is a transition-timing-function declaration with a semicolon. If browser policy denies clipboard access, the declaration remains visible and selectable, and the status does not claim that copying succeeded.
- Paste the declaration into the real component and test it with the intended property, travel distance, and duration. Choose the remaining transition settings separately, check the result in the final interface, and respect reduced-motion preferences when the movement is not essential.
Apply the Curve to a CSS Transition
For a hover-lift button, combine the copied timing function with an explicit property, duration, and state change:
.button { transform: translateY(0); transition-property: transform; transition-duration: 600ms; transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
.button:hover { transform: translateY(-12px); }
The duration, property, travel distance, and hover state are application decisions. The generator produces only the transition-timing-function; it does not generate duration, delay, iteration count, keyframes, spring physics, steps(), linear() stop lists, or a full transition shorthand.
When motion is decorative, a reduced-motion rule can remove the transition while keeping the state change understandable:
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }
Read the 50% Sample Correctly
The five samples answer a question that the control-point diagram alone cannot: at 0, 25, 50, 75, and 100 percent of elapsed input progress, how far has the animated value progressed? For each requested input, the generator finds the curve parameter that produces the requested x coordinate and then evaluates y at that parameter.
That distinction matters when the x control points do not create a linear mapping of time. The curve parameter is not automatically the same thing as elapsed input progress, so the 50 percent sample can differ from evaluating the curve at t equals 0.5. The guide explaining why a CSS cubic-bezier 50% sample can differ from t = 0.5 develops that distinction. A sample above 1 represents real output overshoot, not an invalid x coordinate.
The solver uses bounded Newton iterations and finishes with bisection when necessary, avoiding the mistake of treating the curve parameter as elapsed time. Calculation retains full JavaScript numeric precision, while the serialized declaration rounds numbers to three decimal places. Recheck the visible declaration after copying so the recorded curve matches the one you inspected.
Choose Cubic Bezier or Keyframes for the Bounce
A cubic-bezier timing function is the right fit when the interface needs one transition between two computed states and a brief overshoot adds polish. It works naturally for hover, focus, press, or other state-change motion because the browser interpolates the selected property along the timing curve.
A recognizable bounce with several rebounds is a different task. Build a named keyframe animation, keep the starting and ending positions consistent, add intermediate positions for the high point and progressively smaller rebounds, then apply the animation with the duration and iteration count the component needs. A cubic-bezier can shape how a transition moves through those positions, but it cannot replace the keyframe track itself.
For a spring that responds to velocity or interruption, use a spring-oriented implementation rather than treating one timing curve as physics. The generator deliberately stays with cubic-bezier so the result remains a standards-compatible timing function that is straightforward to inspect, record, and copy.
Validate the Motion in Its Final Context
Review the curve at the real size of the component and with the duration it will use. A short preview can hide the discomfort of a large travel distance, while a long duration can make an overshoot feel slow. Property type, rendering cost, input device, surrounding motion, and interaction direction can all change the perceived result. Run the preview more than once to compare forward and reverse motion, then test the copied declaration where it will ship.
Check that the animated element does not reveal clipped content, leave its container, oscillate rapidly, or make an important state change difficult to understand. A technically valid curve is not automatically accessible, performant, or appropriate. Keep essential state changes understandable without motion, and verify focus and pointer behavior while an element is transitioning.
All curve calculation happens in the browser; no curve, CSS, or interaction data is uploaded, stored, or sent to an animation service. The final check is practical: the copied declaration must be complete, the real transition must use the tested property and duration, and the interaction must remain clear on the target device.
For a deeper look, see CSS Toggle Switch Generator: Set Colors and Geometry.