Splitting Text

Text arrives piece by piece with a staggered blur.

splitting-text.tsx

Installation

1

Install the packages

npm install @prequelui/react motion

@prequelui/react reuses the primitive library your components already depend on.

2

Add the component

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/splitting-text.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/splitting-text.json

3

Turn on the motion

npx @prequelui/cli@latest animate splitting-text

The CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.

Usage

Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.

splitting-text.tsx
import { SplittingText } from "@/components/prequelui/splitting-text";

export default function Demo() {
  return (
    <SplittingText
      text="Every word arrives on time."
      type="words"
      stagger={0.2}
      inView
      className="text-3xl font-medium"
    />
  );
}
import { SplittingText } from "@/components/prequelui/splitting-text";

export function Variant() {
  return (
    <SplittingText tempo={1.2}>
      …
    </SplittingText>
  );
}

Animation

The text is cut into characters, words or lines and every piece enters on its own delay. The default entrance is a 150 px slide from the right with a fade, but initial and animate can be replaced entirely.

  • Piece tween: 700 ms ease-out.
  • Default stagger: 50 ms per character, 200 ms per word, 300 ms per line.
  • The visual copy is hidden from assistive technology; a single label is announced.
  • Reduced motion mounts the final state without travel.
700 ms ease-outstagger 50 mstravel 150 pxin-view once

API Reference

Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.

SplittingText

PropTypeDefault
textstring | string[]—
type"chars" | "words" | "lines""chars"
staggernumber0.05 / 0.2 / 0.3
delaynumber0
inViewbooleanfalse
initialTargetAndTransition{ x: 150, opacity: 0 }

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026