← All components
Mask Text Reveal
TextMasked text reveal — words rise out from behind a clip mask, token by token.
Installation
One command drops the source into your repo — editable, with the provider and motion pulled in automatically.
npx shadcn add https://motion.asmitsah.dev/r/mask-text-reveal.jsonPrerequisiteInstall the provider base first
This component imports from @/lib/motion and needs <MotionProvider> mounted in your root layout — install the base once, before copying this component.
npx shadcn add https://motion.asmitsah.dev/r/provider.jsonStep 1Install the runtime dependency
npm install motionStep 2Copy the source into
components/motion/mask-text-reveal.tsxcomponents/motion/mask-text-reveal.tsx
Usage
By word (default)
Wrap your own element — its tag + className win. Each word sits in its own overflow-hidden mask and rises y: 110% → 0, no opacity fade.
By line
Pass \n-separated text — each line clips and rises inside its own mask, staggered at feel.lineStagger.
With delay
Offset a strapline behind a heading so the two reveals read as a sequence.
Trigger on mount
Play immediately instead of waiting for scroll — for above-the-fold hero text.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactElement | — | A single host element (h1–h6/p/span/div) wrapping plain-string text. Its tag, className + style are reused and it carries the aria-label. Required. |
| by | "word" | "line" | "word" | Split unit: "word" splits on whitespace; "line" splits on \n. |
| trigger | "inView" | "mount" | "inView" | Animate on scroll-into-view (once) or immediately on mount. |
| delay | number | 0 | Seconds before the first token starts staggering in. |