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 stagger

Customize

45ms
22px
Motion Blur

Installation

$pnpm dlx yourbrand@latest add @yourbrand/SplitText-TS-TW
Usage (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

PropTypeDefaultDescription
textstring"Crafted for speed"Headline text to split and animate.
delaynumber45Interval between segments.
offsetYnumber22Initial vertical travel distance.
blurbooleantrueSoften characters during entry.
mode"chars" | "words""chars"Animate per character or per word.