ComponentsReveal
Focus pull
Focus racks from the center letter outward.
Installation
$ npx shadcn@latest add @textlab/focus-pullNeeds @textlab in your components.json. Setup takes a minute.
Usage
usage.tsx
import { FocusPull } from "@/components/textlab/focus-pull/focus-pull";
<FocusPull as="h1" text="Look closer" />Variants
centerstartendProps
| Prop | Type | Default | Description |
|---|---|---|---|
| text* | 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. |
When to use it
Reach for it
- Cinematic title cards and intros.
- A single word that deserves a moment.
Skip it
- Text that must be readable immediately.
- More than about 30 letters.
Accessibility and motion
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.