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
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
Prop | Type | Default | Description |
---|---|---|---|
text | string | required | The text content to animate with rolling effects |
inView | boolean | false | Trigger animation when component enters viewport |
inViewMargin | string | "0px" | Margin for viewport detection trigger |
inViewOnce | boolean | true | Only animate once when entering viewport |
transition | Transition | { 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
Highlight Text
Animated text highlight component with gradient backgrounds and in-view detection. Perfect for React applications requiring text emphasis with Next.js integration and TypeScript support.
Rotating Text
Animated text component that cycles through multiple strings with smooth transitions. Perfect for React applications requiring dynamic content with Next.js integration and TypeScript support.