Join our Discord Community
Text

Rolling Text

3D rolling text animation with character-by-character reveal effects. Perfect for React applications requiring engaging text transitions with Next.js integration and TypeScript support.

Powered by

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/rolling-text.json
npx shadcn@latest add https://www.shadcn.io/registry/rolling-text.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/rolling-text.json
bunx shadcn@latest add https://www.shadcn.io/registry/rolling-text.json

Features

  • 3D character animations with rotateX transforms for realistic rolling effects using Motion
  • Staggered reveals with configurable delay timing for character-by-character animations
  • In-view triggers with viewport detection and once-only animation controls
  • Accessibility support with proper screen reader text and ARIA attributes
  • TypeScript support with complete interface definitions and prop validation
  • shadcn/ui compatibility using standard React patterns and flexible styling

Use Cases

This free open source React component works well for:

  • Hero sections - Eye-catching headlines and taglines built with Next.js
  • Loading states - Text reveals during content loading using TypeScript and Tailwind CSS
  • Page transitions - Smooth text animations between route changes
  • Interactive elements - Hover effects and scroll-triggered text animations

API Reference

RollingText

PropTypeDefaultDescription
textstringrequiredThe text content to animate with rolling effects
inViewbooleanfalseTrigger animation when component enters viewport
inViewMarginstring"0px"Margin for viewport detection trigger
inViewOncebooleantrueOnly animate once when entering viewport
transitionTransition{ duration: 0.5, delay: 0.1, ease: 'easeOut' }Motion transition configuration

Transition Options

  • duration - Animation duration per character (in seconds)
  • delay - Stagger delay between characters (in seconds)
  • ease - Easing function for smooth animations

Implementation Notes

  • Each character is individually animated with 3D transforms
  • Uses CSS perspective and backface-hidden for smooth 3D effects
  • Invisible spacer maintains layout during animation
  • Screen reader text ensures accessibility compliance
  • Compatible with shadcn/ui design system and theming
  • Optimized for performance with transform-based animations