Browse documentation

Reference / Transitions & animation

Animation direction

Play the frames forward, in reverse, or alternate the direction on successive cycles.

Working example

Alternate starts forward and reverses on the next cycle. Give the animation at least two iterations to observe both directions.

HTML
<details class="group rounded border p-4">
  <summary class="cursor-pointer font-semibold">Check the two-pass proof</summary>
  <p class="mt-3 origin-left motion-safe:group-open:animate-wiggle motion-safe:group-open:animate-iteration-2 motion-safe:group-open:animate-direction-alternate">● Inspection mark</p>
</details>

Class reference

ClassCSS declarations
animate-direction-normalanimation-direction: normal;
animate-direction-reverseanimation-direction: reverse;
animate-direction-alternateanimation-direction: alternate;
animate-direction-alternate-reverseanimation-direction: alternate-reverse;
View full generated CSS
Compiled CSS
.animate-direction-alternate {
  animation-direction: alternate;
}
.animate-direction-alternate-reverse {
  animation-direction: alternate-reverse;
}
.animate-direction-normal {
  animation-direction: normal;
}
.animate-direction-reverse {
  animation-direction: reverse;
}