Browse documentation

Reference / Transitions & animation

Animation fill mode

Choose whether the first keyframe applies during a delay and whether the last keyframe persists after the final iteration.

Working example

Both combines backwards and forwards. It keeps this caption at its incoming position during the delay, then at its final position after arrival.

HTML
<details class="group rounded border p-4">
  <summary class="cursor-pointer font-semibold">Place the caption</summary>
  <p class="mt-3 origin-left motion-safe:group-open:animate-slide-in-right motion-safe:group-open:animate-delay-150 motion-safe:group-open:animate-fill-both">Plate 02 · Relief print</p>
</details>

Class reference

ClassCSS declarations
animate-fill-noneanimation-fill-mode: none;
animate-fill-backwardsanimation-fill-mode: backwards;
animate-fill-forwardsanimation-fill-mode: forwards;
animate-fill-bothanimation-fill-mode: both;
View full generated CSS
Compiled CSS
.animate-fill-backwards {
  animation-fill-mode: backwards;
}
.animate-fill-both {
  animation-fill-mode: both;
}
.animate-fill-forwards {
  animation-fill-mode: forwards;
}
.animate-fill-none {
  animation-fill-mode: none;
}