← All components
Line Reveal
TextPer-line rise + fade, staggered and calm — each line clips inside its own mask.
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/line-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/line-reveal.tsxcomponents/motion/line-reveal.tsx
Usage
Basic
Wrap your own element — its tag + className win. Splits the string on \n; each line rises inside its own overflow-hidden wrapper, staggered by feel.lineStagger. aria-label carries the full passage.
trigger="mount"
Play immediately on render instead of waiting for scroll — good for hero copy above the fold.
With delay
Offset a LineReveal behind a sibling to sequence a heading and its body copy.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactElement | — | A single host element (h1–h6/p/span/div) wrapping a plain-string passage split on \n. Its tag, className + style are reused and it carries the aria-label. Required. |
| trigger | "inView" | "mount" | "inView" | inView rises once at 30% visible; mount plays immediately on render. |
| delay | number | 0 | Seconds before the first line's stagger begins. |