# Tracking reveal

> Letter spacing breathes open as it appears.

- Type: Component (reveal)
- Page: https://textlab.dev/components/tracking-reveal
- Markdown: https://textlab.dev/components/tracking-reveal.md
- Registry item: https://textlab.dev/r/tracking-reveal.json
- Source file: `registry/textlab/tracking-reveal/tracking-reveal.tsx`
- Dependencies: motion
- Variants: open, close
- Keywords: tracking, letter spacing, kerning, luxury, breathe

## When to use

- Luxury or editorial titles where restraint matters.
- Short uppercase labels and wordmarks.

## When not to use

- Long titles; the outer letters travel far.
- Body text.

## Installation

### CLI

```bash
npx shadcn@latest add @textlab/tracking-reveal
pnpm dlx shadcn@latest add @textlab/tracking-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/tracking-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 { TrackingReveal } from "@/components/textlab/tracking-reveal/tracking-reveal";

export function Example() {
  return <TrackingReveal as="h2" text="Quiet confidence" />;
}
```

## API reference

### TrackingReveal

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `text` (required) | `string` | – | The copy. |
| `variant` | `"open" \| "close"` | `"open"` | open starts packed and breathes out; close starts wide and gathers in. |
| `spread` | `number` | `0.08` | Distance each letter travels per step from the center, in em. |
| `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. |
| `duration` | `number` | `1.1` | Seconds each part takes. |
| `ease` | `EaseName \| [number, number, number, number]` | `"emphasized"` | 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

- Letters are aria-hidden; the title is read once.
- No reflow, so surrounding layout never moves.

## Motion

- Every letter moves together; distance grows with its offset from the center.
- Uses the emphasized ease for a long, soft landing.

## Reduced motion

Shows the text at its normal spacing.

## Performance

- Transforms instead of letter-spacing, so no layout work per frame.

## 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: open, close.

## Related

- [Focus pull](https://textlab.dev/components/focus-pull.md): Focus racks from the center letter outward.
- [Blur reveal](https://textlab.dev/components/blur-reveal.md): Words sharpen into focus.
- [Character reveal](https://textlab.dev/components/char-reveal.md): Letters arrive one at a time.

## Also in reveal

- [Word reveal](https://textlab.dev/components/word-reveal.md): Words rise out of a clip.
- [Line reveal](https://textlab.dev/components/line-reveal.md): Lines lift in, re-measured on resize.
- [Wipe reveal](https://textlab.dev/components/wipe-reveal.md): A soft edge uncovers the line.
- [In-view title](https://textlab.dev/components/in-view-title.md): Bring a section title in as it scrolls into view.

## Source

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

```tsx
"use client";

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

export type TrackingRevealVariant = "open" | "close";

export interface TrackingRevealProps extends RevealBaseProps {
  /** open starts tightly packed and breathes out; close starts spread wide and gathers in. */
  variant?: TrackingRevealVariant;
  /** How far each letter travels per step from the center, in em. */
  spread?: number;
}

/**
 * Letter spacing breathes open as the word appears. Letters move with transforms from the
 * text's center instead of animating letter-spacing, so nothing reflows.
 */
export function TrackingReveal({ variant = "open", spread = 0.08, duration = 1.1, ease = "emphasized", ...props }: TrackingRevealProps) {
  const sign = variant === "open" ? -1 : 1.6;
  return (
    <RevealText
      by="chars"
      stagger={0}
      duration={duration}
      ease={ease}
      hidden={(i, total) => ({ x: `${(i - (total - 1) / 2) * spread * sign}em`, opacity: 0, filter: "blur(4px)" })}
      {...props}
    />
  );
}

export default TrackingReveal;
```

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