Installation
Usage
- Preview
- Code
Hover over the text to see the smooth shift animation.
API Reference
TextShift
The main text to display initially
The text to reveal on hover
Additional CSS classes for the container
Tailwind color class for the primary text
Tailwind color class for the secondary text
Animation duration in seconds
Delay between each letter animation in seconds
Motion easing function for the animation
Examples
Basic Usage
Simple text shift with default settings:Custom Styling
Customize colors and font size:Custom Timing
Faster animation with quick letter transitions:Slow and Elegant
Slow, elegant animation for a sophisticated effect:Job Title Showcase
Perfect for showcasing multiple skills or titles:Features
Smooth Typography - Beautiful letter-by-letter animations with configurable timing and easing for professional text transitions.
Hover Interactions - Responsive hover effects that trigger smooth transitions between primary and secondary text content.
Staggered Animation - Configurable stagger delay creates a wave-like effect as each letter animates in sequence for visual appeal.
Animation Details
The TextShift component uses Framer Motion under the hood to create smooth, performant animations. Each letter is wrapped in amotion.span element that animates independently, creating the signature staggered effect.
How It Works
- Text Splitting - Both primary and secondary text are split into individual letters
- Layering - Secondary text is positioned absolutely over the primary text
- Hover State - On hover, primary text animates up and fades, while secondary text animates into view
- Staggered Timing - Each letter has a calculated delay based on its index
Use Cases
- Hero section headlines
- Job title or role showcases
- Interactive labels and badges
- Navigation menu items
- Call-to-action buttons
- Portfolio section headers