Browse documentation

Reference / Transitions & animation

Animation timeline

Connect animation progress to a scroll container or an element’s movement through a scrollport.

Working example

The supports variant enables the effect only when view timelines are understood. The base paragraph remains readable in other browsers.

HTML
<div tabindex="0" role="region" aria-label="Scroll to the proof" class="h-28 overflow-y-auto border p-3">
  <p class="h-32">Scroll down to reveal the proof</p>
  <p class="border-l-2 border-black p-2 supports-[animation-timeline:view()]:motion-safe:animate-fade-in supports-[animation-timeline:view()]:motion-safe:animate-duration-[auto] supports-[animation-timeline:view()]:motion-safe:animate-timeline-[view()]">Edition complete</p>
  <div class="h-24" aria-hidden="true"></div>
</div>

Class reference

ClassCSS declarations
animate-timeline-autoanimation-timeline: auto;
animate-timeline-noneanimation-timeline: none;
animate-timeline-[view()]animation-timeline: view();
animate-timeline-[scroll()]animation-timeline: scroll();
View full generated CSS
Compiled CSS
.animate-timeline-\[scroll\(\)\] {
  animation-timeline: scroll();
}
.animate-timeline-\[view\(\)\] {
  animation-timeline: view();
}
.animate-timeline-auto {
  animation-timeline: auto;
}
.animate-timeline-none {
  animation-timeline: none;
}