Installation
Usage
Props
Array of text items to display
Additional CSS classes for the container
Features
- Scroll-Based Animation: Items animate into view as you scroll
- Active Highlighting: Currently visible item is highlighted
- Intersection Observer: Efficient scroll tracking
- Staggered Animation: Items appear with alternating entrance directions
- Spring Physics: Natural-feeling animations with spring physics
How It Works
- Items enter from alternating sides (left/right)
- The centered item is highlighted in full color
- Other items appear dimmed
- Smooth transitions as you scroll
Customization
Animation Details
- Initial State: Items hidden with horizontal offset and rotation
- Entrance: Spring animation brings items into view
- Active State: Full opacity and color
- Inactive State: Reduced opacity (50%)
Dependencies
motion/react- Animation and scroll detectionreact- Hooks (useState, useRef, useEffect)@/lib/utils- cn utility function