SplitText

Letters rise out of a mask one after another on a spring, turning slightly as they land. Text.

Open playground

About

SplitText is a React component in the Text category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { SplitText } from "@ashutoshswamy/smoui" and set text, by, stagger among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { SplitText } from "@ashutoshswamy/smoui";

<SplitText text="Motion with a point of view" className="text-3xl font-semibold" />

Props 4

text

Text to reveal.

string
by

Animate letters or whole words.

"chars""words"default "chars"
stagger

Seconds between pieces.

numberdefault 0.022
replayOnHover

Replay when the pointer enters.

booleandefault false