Documentation
Text Effectstextrevealscroll
Text Reveal
Text that reveals character-by-character on scroll.
text-reveal.tsx
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-mergeUsage
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
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | — | The text string to animate character by character. |
className | string | — | Additional CSS classes for the wrapper. |
delay | number | 0 | Delay in seconds before the animation starts after scrolling into view. |

Sniper UI
An open-source library available on GitHub — contribute or star the repo to support it.
Categories