RemotionUI

Split Text Chars

Split a string into characters, words, or lines and stagger them in. Install with npx remotion-ui@latest add split-text-chars.

PrimitivePrimitives

split-text-chars30fps · 960×540
Install
$ npx remotion-ui@latest add split-text-chars

Splits a string into characters, words, or lines and staggers each unit in.

The default look is deliberately plain. This is the foundation the other text effects are built on: it owns the split, the layout, and the stagger, and hands each unit's own 0–1 progress to renderUnit so an effect only has to describe one glyph.

Modes

mode decides what one animated unit is — chars, words, or lines. The layout is always three levels (line → word → unit) whichever mode is used, so a character split can never break a word across a line.

mode="words" is a word-by-word reveal; there is no separate component for it.

Ordering

order re-ranks which unit animates first without touching document order: start, end, center (middle outward), edges (ends inward), or random. random is seeded, so the same seed renders the same shuffle on every machine and every frame.

Building an effect on it

Effects that draw something other than plain text should skip the component and call the hook, which gives identical splitting and stagger semantics:

import { useSplitText } from "@/remotion/lib/text-split";

const { lines, lastEnterFrame } = useSplitText({
  text,
  mode: "chars",
  order: "center",
});

lastEnterFrame is the frame the final unit lands on — size a <Sequence> with it rather than guessing.

The splitting foundation. Other text effects should call `useSplitText()` from `text-split` rather than re-implementing a split.

Agent notes

Install first, then import the copied source component locally. AI guide →

Import
@/remotion/primitives/split-text-chars
  • Use when: frame-level motion primitives and reusable animation wrappers.
  • Customize: text, mode, order, effect, plus copied source for timing, layout, colors, and typography.
  • Rule: do not import this component from the remotion-ui npm package; it is copied into your project.

Usage

Example
import { SplitTextChars } from "@/remotion/primitives/split-text-chars"; <SplitTextChars text="Ship it on Friday" mode="chars" order="center" /> // Headless: build your own effect on the same split and stagger. import { useSplitText } from "@/remotion/lib/text-split"; const { lines } = useSplitText({ text, mode: "words" });

API Reference

PropTypeDescription
text*stringCopy to split. `\n` starts a new line.
mode"chars" | "words" | "lines"What one animated unit is. `words` is a word-by-word reveal.
order"start" | "end" | "center" | "edges" | "random"Which unit animates first. Document order is never changed.
effect"fade-up" | "fade" | "scale" | "blur" | "none"Built-in look. `none` positions the units and animates nothing.
renderUnit(unit: SplitUnitState) => ReactNodeDraws one unit from its own 0-1 progress. This is the composition point for custom text effects.
staggerInFramesnumberFrames between consecutive units.
durationInFramesnumberLength of one unit's entrance.
delayInFramesnumberFrames before the first unit starts.
springboolean | 'smooth' | 'snappy' | 'bouncy' | Partial<SpringConfig>Drive the entrance with a spring instead of the ease-out curve.
exitbooleanAnimate back out, landing inside the surrounding Sequence.
exitStaggerInFramesnumberFrames between consecutive units leaving.
travelnumber`fade-up` travel distance in em.
fontSizenumberFont size in pixels.
framenumberFrame override — pass the parent frame inside a Sequence.

Related

On this page