We're hitting Vercel's free tier limits! Help keep Sera UI alive.

Text Reveal Animation

A beautiful text reveal animation component that creates a smooth, word-by-word reveal effect with blur and fade transitions. Perfect for hero sections, quotes, and attention-grabbing text content.

Preview

Don’twaitfortheperfectmoment.Takethemomentandmakeitperfect.Consistenteffort,evenwhennooneiswatching,iswhatbuildsgreatnessovertime.

Features

  • Smooth Animation: Word-by-word reveal with staggered timing
  • 🌫️ Blur Effect: Elegant blur-to-clear transition for each word
  • 🎯 Customizable: Easy to modify timing, text, and styling
  • Responsive: Works perfectly on all screen sizes
  • Performance: Optimized with Framer Motion for smooth 60fps animations
  • 🎨 Flexible: Supports any text content and styling

Installation

You can add this component to your project using the CLI or by manually copying the code.

npx shadcn@latest add textreveal.json

Dependencies

This component requires framer-motion for animations. Install it if you haven't already:

Loading...

Basic Usage

Import and use the TextReveal component in your React application:

Loading...

Customization

Custom Text Content

You can easily customize the text content by modifying the textToAnimate variable:

Loading...

Animation Timing

Adjust the animation timing by modifying these values:

Loading...

Styling Options

Customize the appearance by modifying the className and styles:

Loading...

Advanced Examples

Hero Section Implementation

Loading...

Quote Display

Loading...

Animation Properties

PropertyTypeDefaultDescription
staggerChildrennumber0.1Delay between each word animation
delayChildrennumber0.04Initial delay before animations start
durationnumber0.8Duration of each word's animation
easestringeaseInOutEasing function for smooth transitions
blurstring10px → 0pxBlur effect transition
ynumber20 → 0Vertical movement distance

Browser Support

This component works in all modern browsers that support:

  • CSS filter: blur()
  • CSS Flexbox
  • ES6+ JavaScript features
  • Framer Motion (React 16.8+)

Performance Tips

  • The component automatically optimizes animations for 60fps
  • Uses transform and filter properties for hardware acceleration
  • Minimal DOM manipulation for smooth performance
  • Consider using will-change: transform for very long text content

Accessibility

The component maintains accessibility by:

  • Preserving text content for screen readers
  • Not interfering with keyboard navigation
  • Maintaining semantic HTML structure
  • Supporting reduced motion preferences (can be enhanced with prefers-reduced-motion)

Troubleshooting

Animation not working?

  • Ensure framer-motion is properly installed
  • Check that the component is wrapped in a client component ('use client')
  • Verify CSS classes are available in your styling system

Performance issues?

  • Reduce the number of words for very long text
  • Adjust staggerChildren timing for faster reveals
  • Consider using transform3d for better GPU acceleration