Search pages
Search all CSS Showcase pages by name
CSS Scroll-Driven Animations
Animations that respond to scroll position — all in pure CSS. Create parallax effects, reveal animations, and scroll progress indicators without a single line of JavaScript.
The Future of Scroll Effects
For years, scroll-triggered animations required JavaScript libraries, scroll listeners, and performance concerns. CSS Scroll-Driven Animations changes the game — animations driven by scroll position, completely declarative.
Scroll Down
This element fades in as you scroll
animation-timelineLinks an animation to scroll position instead of elapsed time.
scroll()Creates a timeline based on a scroll container's scroll position.
view()Creates a timeline based on an element's visibility in the viewport.
animation-rangeControls precisely when the animation starts and ends during the scroll.
Scroll Progress Indicator
Create reading progress bars that fill as you scroll — perfect for blog posts and articles. The bar below tracks scroll position within its container.
Scroll this container to see the progress bar fill ↓
Section 1: Introduction
Scroll-driven animations replace heavy JavaScript scroll listeners with a declarative, browser-optimised approach.
Section 2: The API
The animation-timeline property accepts scroll() or view() as values to bind animations to scroll position.
Section 3: Practical Uses
From reading progress indicators to parallax backgrounds, scroll-driven animations cover a wide range of use cases.
Section 4: Performance
Because the browser owns the animation, it can run it on the compositor thread — no jank, no layout thrashing.
Reveal on Scroll
Elements animate into view as they enter the viewport — the classic 'scroll reveal' effect, now in pure CSS.
Fade & Scale
Elements smoothly scale up from 80% while fading in from zero opacity.
Slide Up
A translateY of 100px creates a natural upward slide-in motion.
Staggered Timing
Use animation-delay to stagger cards for a cascading entrance effect.
Animation Range
The animation-range property controls precisely when an animation begins and ends relative to the scroll. Here are the key range values.
entryElement is entering the viewport from below. 0% = just touching, 100% = fully inside.
exitElement is leaving the viewport at the top. 0% = fully inside, 100% = just left.
coverEntire journey from first pixel visible to last pixel gone. Combines entry and exit.
containOnly while the element is fully contained within the viewport. Excludes partial visibility.
Browser Support
Scroll-Driven Animations are cutting-edge. Use feature detection to provide graceful fallbacks for browsers that don’t support them yet.
Cutting-Edge Feature
Scroll-Driven Animations are very new!
- Chrome 115+: Fully supported
- Edge 115+: Fully supported
- Firefox: Behind flag
- Safari: In development
For production: Use progressive enhancement. The animations won't run in unsupported browsers, but your content will still be fully visible and usable.
Why This Matters
Scroll-Driven Animations eliminate common problems with JavaScript-based scroll effects.
Browser-optimised, runs on the compositor thread — no jank.
Pure CSS means no scroll listeners, no IntersectionObserver, no libraries.
Define the animation and its trigger — the browser handles scheduling.
Automatically respects prefers-reduced-motion when combined with media queries.
Keep Learning
Explore related animation and modern CSS features.