Browse documentation
Reference / Transitions & animation
Animation range
Select the portion of a scroll-driven timeline over which an animation progresses. Set both endpoints together or adjust either one separately.
Working example
Scroll down to the colophon.
Colophon
Underscores inside the brackets represent spaces in the CSS range. Here the fade starts upon entry and completes early in the cover range.
<div tabindex="0" role="region" aria-label="Scroll through the proof" class="h-28 overflow-y-auto border p-3">
<p class="h-32">Scroll down to the colophon.</p>
<p class="bg-black p-3 text-white 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()] supports-[animation-timeline:view()]:motion-safe:animate-range-[entry_0%_cover_40%]">Colophon</p>
<div class="h-24" aria-hidden="true"></div>
</div>Class reference
| Class | CSS declarations |
|---|---|
animate-range-normal | animation-range: normal; |
animate-range-[entry_0%_cover_40%] | animation-range: entry 0% cover 40%; |
animate-range-start-[entry_10%] | animation-range-start: entry 10%; |
animate-range-end-[cover_70%] | animation-range-end: cover 70%; |
View full generated CSS
.animate-range-\[entry_0\%_cover_40\%\] {
animation-range: entry 0% cover 40%;
}
.animate-range-normal {
animation-range: normal;
}
.animate-range-end-\[cover_70\%\] {
animation-range-end: cover 70%;
}
.animate-range-start-\[entry_10\%\] {
animation-range-start: entry 10%;
}