Loading component…
Loading component…
Text that arrives word by word or letter by letter
import { TextReveal } from "@/components/ui/text-reveal";
export function Intro() {
return <TextReveal as="h2" text="Words that arrive one at a time." />;
}| Name | Type | Default | Description |
|---|---|---|---|
| text | string | The text to reveal | |
| by | "word" \| "char" | "word" | Reveal word by word or letter by letter |
| stagger | number | 40 | Time between two pieces, in ms |
| delay | number | 0 | Wait before the first piece, in ms |
| duration | number | 700 | Time each piece takes to arrive, in ms |
| as | "p" \| "h1" \| "h2" \| "h3" \| "span" | "p" | Element to render |
| once | boolean | true | Reveal only the first time; otherwise it plays again each time it enters the view |
| className | string | Extra class on the root |
Font, size and color come from the parent, so it fits any heading or paragraph
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"
@import "tailwindcss"; in your main CSS file.