Flip Fade Text
A stunning 3D animated text component that cycles through customizable words with elegant letter-by-letter flip animations. Perfect for loading states, splash screens, and hero sections.
LOADING
Install using CLI
npx shadcn@latest add "https://vengeance-ui.vercel.app/r/flip-fade-text.json"Install Manually
1
Install dependencies
2
Add util file
lib/utils.ts
3
Copy the source code
Copy the code below and paste it into components/ui/flip-fade-text.tsx
Usage
Examples
Custom Words
SYNCING
Fast Animation
FAST
Custom Styling
HELLO
Props
| Prop Name | Type | Default | Description |
|---|---|---|---|
| words | string[] | ["LOADING", "COMPUTING", ...] | Array of words to cycle through in the animation. |
| interval | number | 2500 | Time in milliseconds between word transitions. |
| className | string | undefined | Additional CSS classes for the container element. |
| textClassName | string | undefined | Additional CSS classes for the text/word element. |
| letterDuration | number | 0.6 | Duration in seconds for each letter's animation. |
| staggerDelay | number | 0.1 | Delay in seconds between each letter's entrance animation. |
| exitStaggerDelay | number | 0.05 | Delay in seconds between each letter's exit animation. |
Features
- 🎭 3D Flip Animation - Letters rotate in 3D space with blur and transform effects
- ⚡ Performance Optimized - Memoized components prevent unnecessary re-renders
- 🎨 Fully Customizable - Control words, timing, colors, and animation speeds
- 🌙 Dark Mode Ready - Automatic theme adaptation
- 📱 Responsive - Scales beautifully across all screen sizes
- ♿ Accessible - Preserves 3D transforms for visual appeal while maintaining readability
Performance Considerations
The FlipFadeText component is optimized for performance:
- Memoized Components: Both
LetterandWordsub-components are wrapped withReact.memo()to prevent unnecessary re-renders - Callback Optimization: The interval update function is memoized with
useCallback - Value Memoization: Current word and letter arrays are memoized with
useMemo - CSS Hardware Acceleration: 3D transforms trigger GPU acceleration for smooth animations
- Proper Cleanup: Interval is properly cleared on unmount to prevent memory leaks
Accessibility
For production use with loading states, consider adding:
<div role="status" aria-live="polite">
<FlipFadeText />
<span className="sr-only">Loading content...</span>
</div>