Scroll Animations
How to implement scroll triggered animations
For scroll-triggered animations, you'll need to use an additional library alongside Rombo for Tailwind as it doesn't support scroll animations yet.
In this guide, we'll show you how to implement scroll animations using tailwindcss-intersect.
Installation
First, install the tailwindcss-intersect
plugin:
Then, add the plugin to your Tailwind configuration:
Setting Up the Observer
The plugin requires an observer to be initialized. Choose the appropriate setup based on your project:
Add the component to your project:
And then wrap your app with the ObserverProvider
:
Basic Usage
Add the intersect:
prefix to any Rombo animation class to trigger it when the element enters the viewport:
One-Time Animations
Add the intersect-once
class to trigger the animation only the first time an element enters the viewport:
Examples
Staggered List Items
Create a staggered animation effect for list items:
Combined Animations
Mix multiple animations that trigger on scroll: