Text Generate Effect, animated React component
Text that streams in like a model writing it: each word, character or line springs up out of a blur on its own beat and overshoots a hair before settling. A glowing caret rides on the newest token while it generates.
- Free
- Motion Effects
- Spring
- Scroll
Like Text Generate Effect? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Text Generate Effect stays free.
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Build elegant interfaces that feel alive, readable, and deeply polished.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| text | string | — | The text to stream in. Use \n for line breaks (and as the separator in line mode). |
| mode | "word" | "character" | "line" | "word" | What arrives on each beat. Character mode never breaks inside a word. |
| delay | number | 0 | Seconds before the first token arrives. |
| duration | number | 0.48 | Seconds each token takes to settle; sets the spring's speed. |
| stagger | number | 0.06 | Seconds between tokens. |
| blur | boolean | true | Tokens arrive out of a blur. |
| lift | boolean | true | Tokens rise into place with a small overshoot. |
| showCaret | boolean | true | Glowing caret that rides on the newest token while text streams in. |
| trigger | "mount" | "viewport" | "mount" | Start on mount, or when the text scrolls into view. |
| once | boolean | true | With the viewport trigger, play once or every time it enters view. |
| replayKey | string | number | — | Change it to replay the effect. |
| as | "p" | "h1" | "h2" | "span" | "div" | "p" | Root element. |
| className | string | — | Classes for the root element. |
| onComplete | () => void | — | Called when the last token has arrived. |
| autoplay | boolean | false | Dissolves and regenerates every few seconds until someone clicks or taps the text. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor you:npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"Type it exactly as shown.
{name}is filled in by the CLI with the component you ask for, so you never replace it.
- 3
Add the component
Run this from your project root. It adds the component, the helpers it imports and its npm packages.
npx shadcn@latest add @nexus-labs/text-generate-effect
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/text-generate-effect.tsxtext-generate-effect/index.tstext-generate-effect.tsx - 5
Copying by hand? Skip the registry
Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that
cn()exists. Install the packages:npm install framer-motion
Then show the source and create each file at the path it gives:
- 6
Use it in a page
Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:
// src/app/page.tsx import { TextGenerateEffect } from "@/components/text-generate-effect"; export default function Page() { return ( <main> <TextGenerateEffect /> </main> ); }
Like Text Generate Effect? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Text Generate Effect stays free.
About Text Generate Effect
The Text Generate Effect reveals text word by word, with each word fading in from a blur using staggered Framer Motion animations. The blur-to-clear transition on each word creates the impression of AI-generated text appearing in real time. The stagger delay is configurable to match different text lengths. Use it for hero headlines, feature descriptions, or any marketing copy that benefits from a dramatic sequential entrance rather than appearing all at once.
Good for
- AI product hero headlines
- Feature description reveal animations
- Landing page copy entrance effects
- AI interface streaming text simulations
Text Generate Effect questions
How do I install the text generate effect?
Run `npx shadcn@latest add @nexus-labs/text-generate-effect`. It adds the TextGenerateEffect component and installs framer-motion.
Can it start when the text scrolls into view?
Yes. Set `trigger="viewport"` to animate when the element enters the viewport, and `once` (default true) controls whether it replays. Changing `replayKey` restarts the animation.
Which props control the timing?
`duration` (0.48s) is the time per segment, `stagger` (0.06s) the gap between segments, and `delay` the wait before the first. `blur` and `lift` toggle the blur-to-clear and upward motion, and `mode` picks word, character or line.
Is it accessible?
Yes. The full sentence sits in a visually hidden span for screen readers while the animated pieces are hidden from them, and with prefers-reduced-motion on, the text appears without animation.