Overview
Scroll timeline animations link animation progress directly to the user’s scroll position. Unlike view timelines that trigger when elements enter the viewport, scroll timelines continuously progress the animation as the user scrolls, creating dynamic, interactive experiences.Scroll timeline animations require browser support for the CSS
animation-timeline property. This is a modern CSS feature with limited browser support. Check Can I Use for current compatibility.Basic Usage
Use thetimeline-scroll class to link an animation to scroll progress:
Timeline Variants
Default Scroll
Directional Scrolling
Block and Inline Directions
Combining with Animations
Scroll timelines work with any animation class from the library:Rotation Effects
Scale and Transform
Fade Effects
Controlling Animation Speed
Useanimate-duration-* classes to control how the animation maps to scroll distance:
Scroll Timeline Axis
Control which scroll direction drives the animation:Real-World Examples
Parallax Effect
Progress Indicator
Rotating Logo
Scrolling Cards
Advanced Techniques
Combining with Easing
Reversing Animations
Multiple Animations
Best Practices
Performance Tips
-
Use will-change sparingly:
-
Avoid layout-triggering properties:
- ✅ Use:
transform,opacity - ❌ Avoid:
width,height,margin,padding
- ✅ Use:
-
Debounce complex effects:
- Keep animations simple and lightweight
- Avoid animating many elements simultaneously
Accessibility Considerations
-
Respect
prefers-reduced-motion: - Ensure content is readable without animations
- Don’t hide critical information in scroll-driven animations
- Test with screen readers
Browser Support
Limited Browser Support:
Scroll timeline animations are a cutting-edge CSS feature with limited browser support. Always provide fallbacks: