CSS <easing-function> Data Type
The <easing-function> data type sets how the speed of a transition or animation changes over time, such as ease-in-out, steps() or cubic-bezier().
Description
The <easing-function> CSS data type describes how the speed of a transition or animation changes over its duration. Rather than moving at a constant pace, an animation can start slowly and speed up, slow down at the end, overshoot its target or move in steps. It is used by transition-timing-function, animation-timing-function and the transition and animation shorthands.
An easing function maps the progress of time (from 0 to 1) to the progress of the value (usually also from 0 to 1, though it can go beyond). There are three families. The linear keyword and the linear() function join points with straight lines, and linear() can approximate bounces and springs. The ease, ease-in, ease-out and ease-in-out keywords and the cubic-bezier() function produce smooth curves. The step-start and step-end keywords and the steps() function jump between a fixed number of values.
The default for both transitions and animations is ease. In general, ease-out curves feel responsive for elements entering the screen, and ease-in curves suit elements leaving it.
Examples:
.menu {
transition: transform 300ms ease-out;
}
.loader {
animation: spin 1s linear infinite;
}
.pop {
transition: scale 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.clock-hand {
animation: tick 60s steps(60) infinite;
}
Interactive Demo
Syntax
<easing-function> = <linear-easing-function> | <cubic-bezier-easing-function> | <step-easing-function> <linear-easing-function> = linear | <linear()> <cubic-bezier-easing-function> = ease | ease-in | ease-out | ease-in-out | <cubic-bezier()> <step-easing-function> = step-start | step-end | <steps()>
Values
- linearConstant speed from start to finish. Equivalent to linear(0, 1).
- easeStarts quickly, then slows toward the end. The default. Equivalent to cubic-bezier(0.25, 0.1, 0.25, 1).
- ease-inStarts slowly and speeds up. Equivalent to cubic-bezier(0.42, 0, 1, 1).
- ease-outStarts quickly and slows down. Equivalent to cubic-bezier(0, 0, 0.58, 1).
- ease-in-outStarts and ends slowly. Equivalent to cubic-bezier(0.42, 0, 0.58, 1).
- step-startJumps to the end value immediately. Equivalent to steps(1, jump-start).
- step-endHolds the start value until the end, then jumps. Equivalent to steps(1, jump-end).
- linear()A custom piecewise linear easing defined by a list of points.
- cubic-bezier()A custom curve defined by two control points.
- steps()A stepped easing with a given number of steps and jump position.
Example
Browser Support
The following information will show you the current browser support for the CSS easing-function data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





