Skip to content

ease()

A CSS function that generates cubic-bezier easing values.

Syntax

css
ease('{type}.{direction}')

Types

TypeDescription
sineSubtle, gentle easing
quadQuadratic (power of 2)
cubicCubic (power of 3)
quartQuartic (power of 4)
quintQuintic (power of 5)
expoExponential
circCircular
backOvershoots slightly
power1Alias for quad
power2Alias for cubic
power3Alias for quart
power4Alias for quint

Directions

DirectionDescription
inStarts slow, ends fast
outStarts fast, ends slow
inOutSlow at both ends

Usage

css
.element {
  transition: all 300ms ease('cubic.out');
}

.modal {
  transition: transform 400ms ease('quart.inOut');
}

.button {
  transition: background-color 200ms ease('sine.out');
}

.drawer {
  transition: transform 500ms ease('expo.out');
}

.bounce {
  transition: transform 600ms ease('back.out');
}

Output

css
/* Input */
transition: all 300ms ease('cubic.out');

/* Output */
transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1);