Browse documentation

Reference / Transitions & animation

Animation iteration count

Choose how many times an animation cycles. Whole numbers, fractions, and infinite are supported.

Working example

A fractional count stops during the final cycle. Pair it with a forwards fill mode when the endpoint should stay visible.

HTML
<details class="group rounded border p-4">
  <summary class="cursor-pointer font-semibold">Pulse twice</summary>
  <p class="mt-3 origin-left motion-safe:group-open:animate-pulse motion-safe:group-open:animate-iteration-2 motion-safe:group-open:animate-duration-700">● Printer online</p>
</details>

Class reference

ClassCSS declarations
animate-iteration-1animation-iteration-count: 1;
animate-iteration-2animation-iteration-count: 2;
animate-iteration-3animation-iteration-count: 3;
animate-iteration-1.5animation-iteration-count: 1.5;
animate-iteration-infiniteanimation-iteration-count: infinite;
View full generated CSS
Compiled CSS
.animate-iteration-1 {
  animation-iteration-count: 1;
}
.animate-iteration-1\.5 {
  animation-iteration-count: 1.5;
}
.animate-iteration-2 {
  animation-iteration-count: 2;
}
.animate-iteration-3 {
  animation-iteration-count: 3;
}
.animate-iteration-infinite {
  animation-iteration-count: infinite;
}