Documentation
Text Effectstextrevealscroll

Text Reveal

Text that reveals character-by-character on scroll.

SniperUImakesinterfacesbeautiful.

Installation

Terminal
1npx shadcn@latest add "https://sniper-ui-coral.vercel.app/r/text-reveal.json"

Auto-Installed Dependencies

The CLI will automatically install these packages.

Terminal
1npm install framer-motion clsx tailwind-merge

Usage

Basic

page.tsx
1import { TextReveal } from "@/components/ui/text-reveal"; 2 3export default function MyPage() { 4 return ( 5 <h1 className="text-4xl font-bold"> 6 <TextReveal text="Hello, world!" /> 7 </h1> 8 ); 9}

Examples

examples.tsx
1import { TextReveal } from "@/components/ui/text-reveal"; 2 3export default function MyPage() { 4 return ( 5 <div className="space-y-4"> 6 {/* Staggered headings */} 7 <h1 className="text-5xl font-bold"> 8 <TextReveal text="Build something" /> 9 </h1> 10 <h2 className="text-3xl text-muted-foreground"> 11 <TextReveal text="extraordinary today." delay={0.5} /> 12 </h2> 13 </div> 14 ); 15}

Props

PropTypeDefaultDescription
textstringThe text string to animate character by character.
classNamestringAdditional CSS classes for the wrapper.
delaynumber0Delay in seconds before the animation starts after scrolling into view.