Split Text
ComponentsSplit Text
Typography

Split Text

An expressive word-by-word reveal for headlines that deserve an entrance.

React + CSS
ONE WORD AT A TIME

Good things take motion.

A staggered entrance.
Live component. Go ahead, interact.
01

Installation

Run this in your shadcn-configured React project. The component and stylesheet are added together.

TERMINAL
npx shadcn@latest add http://localhost:5173/r/split-text.json

This command uses the current site address. For localhost, keep this preview running on the same computer. Files follow your configured components alias.

02

Usage

Import the component and make the details your own.

TypeScript
import { SplitText } from '@/components/anticraft/SplitText';

export function Example() {
  return <SplitText as="h2" text="Less ordinary. More you." delay={0.08} />;
}
03

Props

PropTypeDefaultDescription
textstringRequiredThe complete phrase to reveal. Screen readers receive one uninterrupted copy.
as'h1' | 'h2' | 'h3' | 'p' | 'span''p'The semantic element wrapping the phrase.
delaynumber0.06The stagger between words in seconds.
replayKeynumber0Change this value to replay the reveal.
classNamestring''Additional classes for typography and layout.
04

Motion & accessibility

Considered by default.

Reveals once on entering the viewport. With reduced motion, the complete phrase is immediately visible without animation.

Use semantic content and meaningful labels in your composition. Check contrast and keyboard behavior with your own styles and content.