Text Cascade
Rolls text letter by letter whenever its value changes.
@paneui/thememotion
Installation
pnpm dlx shadcn@latest add @paneui/text-cascadeUsage
Examples
Motion
Each letter moves on a spring (460 / 32 / 0.55) and exits take half the stagger. With reduced motion the word cross-fades and the width snaps. Screen readers read the current text once from a hidden copy.
Related
Text Shimmer, Text Scramble, Text Reveal. Reasoning Text uses it for streamed labels.
TextCascade
Letter-by-letter slot roll between the previous and current text. Also accepts every prop of motion.span.
- text*
- string
- Current text. Changing it rolls the letters, left to right, to the new value.
- stagger= 0.025
- number
- Seconds between neighbouring letters.
- animateWidth= true
- boolean
- Glide the wrapper between the old and new widths (otherwise it snaps).
| Prop | Type | Default | Description |
|---|---|---|---|
| text* | string | — | Current text. Changing it rolls the letters, left to right, to the new value. |
| stagger | number | 0.025 | Seconds between neighbouring letters. |
| animateWidth | boolean | true | Glide the wrapper between the old and new widths (otherwise it snaps). |
- data-slot
- "text-cascade"
| Data attribute | Description |
|---|---|
| data-slot | "text-cascade" |