ease, the default, starts somewhat quickly, slows through the middle, and eases gently into its final value, generally feeling like the most natural default for most UI transitions; linear moves at a perfectly constant rate throughout with no acceleration or deceleration at all, which can feel mechanical or robotic for many everyday UI interactions; ease-in starts slowly and accelerates toward the end; ease-out starts quickly and decelerates gently into its final value, often feeling like the most natural choice specifically for elements entering or appearing; and a custom cubic-bezier() function allows defining an entirely custom acceleration curve beyond these standard presets.
1Understanding Transition-timing-function
ease, the default, starts somewhat quickly, slows through the middle, and eases gently into its final value, generally feeling like the most natural default for most UI transitions; linear moves at a perfectly constant rate throughout with no acceleration or deceleration at all, which can feel mechanical or robotic for many everyday UI interactions; ease-in starts slowly and accelerates toward the end; ease-out starts quickly and decelerates gently into its final value, often feeling like the most natural choice specifically for elements entering or appearing; and a custom cubic-bezier() function allows defining an entirely custom acceleration curve beyond these standard presets.
ease-out generally feels like the most natural choice specifically for an element entering, appearing, or moving into place, since real-world motion typically decelerates as it settles into a final resting position, rather than maintaining constant speed or accelerating right up until it suddenly stops.
.modal {
transition: transform 0.3s ease-out;
}2Practical Example
Here is a real-world application of Transition-timing-function showing how it is used in production CSS code.
.spinner {
animation: spin 1s linear infinite;
}3Best Practices
Follow these guidelines when working with Transition-timing-function:
1. Use ease-out for elements entering or appearing, since decelerating into a final position generally feels more natural than a constant or accelerating motion
2. Avoid linear for most everyday UI transitions, since a perfectly constant rate of change tends to feel mechanical rather than natural, reserving it more for specific effects like a continuously rotating loading spinner
3. Use a custom cubic-bezier() function for a specific, distinctive motion feel that the standard preset keywords don't quite capture
Tip: ease-out generally feels like the most natural choice specifically for an element entering, appearing, or moving into place, since real-world motion typically decelerates as it settles into a final resting position, rather than maintaining constant speed or accelerating right up until it suddenly stops.
.modal {
transition: transform 0.3s ease-out;
}