# Word reveal

> Words rise out of a clip.

- Type: Component (reveal)
- Page: https://textlab.dev/components/word-reveal
- Markdown: https://textlab.dev/components/word-reveal.md
- Registry item: https://textlab.dev/r/word-reveal.json
- Source file: `registry/textlab/word-reveal/word-reveal.tsx`
- Dependencies: motion
- Variants: rise, fall, scale
- Keywords: word, rise, clip, mask, heading, stagger

## When to use

- Editorial headlines where each word should land with weight.
- Hero lines on load with trigger="mount".

## When not to use

- Long paragraphs; the stagger gets slow past ~20 words.
- Text inside buttons or form labels.

## Installation

### CLI

```bash
npx shadcn@latest add @textlab/word-reveal
pnpm dlx shadcn@latest add @textlab/word-reveal
```

The `@textlab` name needs `"registries": { "@textlab": "https://textlab.dev/r/{name}.json" }` in `components.json`. Without it, use the full URL:

```bash
npx shadcn@latest add https://textlab.dev/r/word-reveal.json
```

Import the tokens once in your root layout: `import "@/components/textlab/tokens.css";`

### Manual

1. Install the dependencies: `npm install motion@12`
2. Copy `text-fx` (https://textlab.dev/r/text-fx.json) and this component into `components/textlab/`.

## Usage

```tsx
import { WordReveal } from "@/components/textlab/word-reveal/word-reveal";

export function Example() {
  return <WordReveal as="h1" text="Ship the story, not the slides" />;
}
```

## API reference

### WordReveal

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `text` (required) | `string` | – | The copy. |
| `variant` | `"rise" \| "fall" \| "scale"` | `"rise"` | rise comes up from below the line, fall drops from above, scale grows from the baseline. |
| `as` | `ElementType` | `"span"` | Rendered element. |
| `trigger` | `"mount" \| "inView" \| "hover" \| "manual"` | `"inView"` | What starts the animation. manual follows `active`. |
| `active` | `boolean` | `false` | Drives trigger="manual". |
| `once` | `boolean` | `true` | In view: play once instead of on every entry. |
| `delay` | `number` | `0` | Seconds before the first part moves. |
| `stagger` | `number` | `0.06` | Seconds between parts. |
| `duration` | `number` | `0.8` | Seconds each part takes. |
| `ease` | `EaseName \| [number, number, number, number]` | `"enter"` | Easing token or cubic bezier. |
| `reducedMotion` | `"user" \| "always" \| "never"` | `"user"` | user follows the OS setting; always shows the still version. |
| `className` | `string` | – | Merged onto the root. |
| `onComplete` | `() => void` | – | Called when a one-shot animation finishes. |

## Accessibility

- Screen readers get the full sentence once; the clipped words are aria-hidden.
- Pass as="h1" or as="h2" to keep the outline.

## Motion

- Each word travels its own height, so the motion scales with font size.
- Words start 60 ms apart and settle with the enter ease.

## Reduced motion

Renders the sentence in place with no clip or movement.

## Responsive behavior

- Words wrap naturally at any width; each word animates on its own line.

## Performance

- Transform and opacity only.
- One motion span per word.

## Notes for AI

- Use only the props documented above. Do not invent props.
- Keep the screen-reader text and the reduced-motion branch when editing the source.
- Pick a variant from: rise, fall, scale.

## Related

- [Line reveal](https://textlab.dev/components/line-reveal.md): Lines lift in, re-measured on resize.
- [Blur reveal](https://textlab.dev/components/blur-reveal.md): Words sharpen into focus.
- [In-view title](https://textlab.dev/components/in-view-title.md): Bring a section title in as it scrolls into view.

## Also in reveal

- [Character reveal](https://textlab.dev/components/char-reveal.md): Letters arrive one at a time.
- [Wipe reveal](https://textlab.dev/components/wipe-reveal.md): A soft edge uncovers the line.
- [Split text](https://textlab.dev/components/split-text.md): Stagger anything by chars, words or lines.
- [Tracking reveal](https://textlab.dev/components/tracking-reveal.md): Letter spacing breathes open as it appears.

## Source

### components/textlab/word-reveal/word-reveal.tsx

```tsx
"use client";

import { RevealText, type RevealBaseProps } from "../lib/reveal";

export type WordRevealVariant = "rise" | "fall" | "scale";

export interface WordRevealProps extends RevealBaseProps {
  /** rise comes up from below the line, fall drops in from above, scale grows from the baseline. */
  variant?: WordRevealVariant;
}

const HIDDEN = {
  rise: { y: "110%" },
  fall: { y: "-110%" },
  scale: { scale: 0.4, opacity: 0, y: "20%" },
} as const;

/** Words rise out of a clip, one after another. The clip keeps descenders and leaves layout untouched. */
export function WordReveal({ variant = "rise", ...props }: WordRevealProps) {
  return (
    <RevealText
      by="words"
      clip={variant !== "scale"}
      hidden={HIDDEN[variant]}
      partStyle={variant === "scale" ? { transformOrigin: "50% 100%" } : undefined}
      {...props}
    />
  );
}

export default WordReveal;
```

Full library index: https://textlab.dev/llms.txt
