Split Text
Web (React)
Staggered text animations splitting by characters, words, or lines.
Staggered text animations splitting by characters, words, or lines. A native Framer Motion implementation that achieves the same beautiful effect as GSAP's premium SplitText plugin without the cost or bundle size.
The details are not the details.
They make the design.
Installation
CLI
npx @modus-ui/cli add split-textManual
- Copy the code from the component tab.
- Create a file at
components/ui/split-text.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | - | The text to animate. |
delay | number | 0.05 | Seconds between each segment. |
duration | number | 0.5 | Seconds each segment animates for. |
splitType | "chars" | "words" | "lines" | "chars" | How the text is split into segments. |
threshold | number | 0.1 | Fraction visible before the animation starts. |
textAlign | "left" | "center" | "right" | "justify" | "center" | Text alignment. |
as | React.ElementType | "p" | Element to render as. |
Comments