cnippet/ui
  1. motion
  2. text animations
  3. splitting text

text animations

Splitting Text

Text is split into characters, words, or lines and each segment animates in with a staggered entrance. Five built-in presets — fade, slide-up, slide-down, blur, and scale.

Installation

Usage

Anatomy

Good to know

  • children must be a plain string. splitBy is "chars", "words" or "lines".
  • preset is "fade", "slide-up", "slide-down", "blur" or "scale".
  • It plays as soon as it mounts. Set trigger={false} and switch it to true to start it later, for example with useInView.
  • Screen readers read the full text once; the pieces are hidden from them.
  • When the user has turned on reduced motion, the text shows in its final state straight away, with no stagger or movement.

Props

Examples

Hero Headline

Word-level slide-up with a spring transition — the standard pattern for landing page headings.

Preset Explorer

Buttons switch the preset and re-mount the component via key. Demonstrates all five presets on character-level splitting.

Stacked Content Block

Three SplittingText instances — eyebrow, headline, body — each using a different preset and split granularity to build a complete hero section.