Split Text
Splits display typography into masked inline-block spans that glide up smoothly with configurable stagger, blur-to-sharp settling, and spring easing.
#typography#stagger#entrance#editorial
Crafted for speed
Hover or click to replay staggerCustomize
45ms
22px
Motion Blur
Installation
$pnpm dlx yourbrand@latest add @yourbrand/SplitText-TS-TWUsage (synced with live props)
<SplitText
text="Crafted for speed"
delay={45}
offsetY={22}
blur
mode="chars"
/>Source Code
SplitText.tsx"use client";
import React from "react";
export interface SplitTextProps {
text?: string;
delay?: number;
offsetY?: number;
blur?: boolean;
mode?: "chars" | "words";
}
export function SplitText({
text = "Crafted for speed",
delay = 45,
offsetY = 22,
blur = true,
mode = "chars",
}: SplitTextProps) {
const tokens = mode === "words" ? text.split(" ") : Array.from(text);
return (
<span className="inline-flex flex-wrap justify-center gap-x-1.5 text-4xl font-medium tracking-tight text-white">
{tokens.map((token, idx) => (
<span
key={idx}
className="inline-block animate-[lh-rise_0.75s_cubic-bezier(0.23,1,0.32,1)_both]"
style={{
animationDelay: `${idx * delay}ms`,
filter: blur ? "blur(0px)" : undefined,
transform: `translateY(0px)`,
}}
>
{token === " " ? "\u00A0" : token}
</span>
))}
</span>
);
}
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | "Crafted for speed" | Headline text to split and animate. |
| delay | number | 45 | Interval between segments. |
| offsetY | number | 22 | Initial vertical travel distance. |
| blur | boolean | true | Soften characters during entry. |
| mode | "chars" | "words" | "chars" | Animate per character or per word. |