# Focus pull

> Focus racks from the center letter outward.

- Type: Component (reveal)
- Page: https://textlab.dev/components/focus-pull
- Markdown: https://textlab.dev/components/focus-pull.md
- Registry item: https://textlab.dev/r/focus-pull.json
- Source file: `registry/textlab/focus-pull/focus-pull.tsx`
- Dependencies: motion
- Variants: center, start, end
- Keywords: focus, rack focus, lens, blur, cinematic

## When to use

- Cinematic title cards and intros.
- A single word that deserves a moment.

## When not to use

- Text that must be readable immediately.
- More than about 30 letters.

## Installation

### CLI

```bash
npx shadcn@latest add @textlab/focus-pull
pnpm dlx shadcn@latest add @textlab/focus-pull
```

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/focus-pull.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 { FocusPull } from "@/components/textlab/focus-pull/focus-pull";

export function Example() {
  return <FocusPull as="h1" text="Look closer" />;
}
```

## API reference

### FocusPull

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `text` (required) | `string` | – | The copy. |
| `variant` | `"center" \| "start" \| "end"` | `"center"` | Where focus lands first. |
| `blur` | `number` | `14` | Starting blur in px. |
| `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.045` | Seconds between parts. |
| `duration` | `number` | `0.9` | 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

- Letters are aria-hidden; the word is read once.
- Starts at low opacity rather than invisible, so the shape is present early.

## Motion

- Letters sharpen in order of distance from the focal letter.
- Scale settles with blur, like a lens finding focus.

## Reduced motion

The text is sharp and still from the start.

## Performance

- Per-letter blur is costly; keep it to display words.

## 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: center, start, end.

## Related

- [Blur reveal](https://textlab.dev/components/blur-reveal.md): Words sharpen into focus.
- [Tracking reveal](https://textlab.dev/components/tracking-reveal.md): Letter spacing breathes open as it appears.
- [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/focus-pull/focus-pull.tsx

```tsx
"use client";

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

export type FocusPullVariant = "center" | "start" | "end";

export interface FocusPullProps extends RevealBaseProps {
  /** Where focus lands first: the middle letter, the first or the last. */
  variant?: FocusPullVariant;
  /** Starting blur in px. */
  blur?: number;
}

/**
 * Focus racks across the word like a camera lens. Letters start soft and slightly too large,
 * then sharpen in order from the focal point outward.
 */
export function FocusPull({ variant = "center", blur = 14, stagger = 0.045, duration = 0.9, ...props }: FocusPullProps) {
  return (
    <RevealText
      by="chars"
      order={variant}
      stagger={stagger}
      duration={duration}
      hidden={{ opacity: 0.15, filter: `blur(${blur}px)`, scale: 1.25 }}
      partStyle={{ transformOrigin: "50% 60%" }}
      {...props}
    />
  );
}

export default FocusPull;
```

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