SplitReveal

Splits text into characters, words, or lines and reveals each unit on scroll. Built on SplitText + ScrollTrigger.

The quick brown fox jumps.

Usage

import { SplitReveal } from '@bwo-ui/react';

<SplitReveal type="words,chars" stagger={0.02} from={{ y: 40, opacity: 0 }}>
  <h1>Your shortcut to a beautiful UI.</h1>
</SplitReveal>

Props

PropTypeDefaultDescription
type'chars' | 'words' | 'lines' | 'words,chars' | 'chars,words,lines''words'What to split the text into.
staggernumber0.04Stagger between units in seconds.
durationnumber0.6Per-unit tween duration.
from{ y?, x?, opacity?, rotate?, scale? }{ y: 24, opacity: 0 }Starting transform/opacity for each unit.
easestring'power3.out'GSAP ease.
scrubboolean | numberfalseWhen true (or a lag number), the tween scrubs with scroll.
oncebooleantruePlay only once when entering the viewport.
startstring'top 85%'ScrollTrigger start position.
mask'lines' | 'words' | 'chars' | falsefalseWrap each unit in an overflow-clip mask for clean reveals.

Notes