Skip to content
Textlab
1
Browse

ComponentsReveal

Focus pull

Focus racks from the center letter outward.

Look closer

Installation

$ npx shadcn@latest add @textlab/focus-pull

Needs @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

centerstartend

Props

PropTypeDefaultDescription
text*string–The copy.
variant"center" | "start" | "end""center"Where focus lands first.
blurnumber14Starting blur in px.
asElementType"span"Rendered element.
trigger"mount" | "inView" | "hover" | "manual""inView"What starts the animation. manual follows `active`.
activebooleanfalseDrives trigger="manual".
oncebooleantrueIn view: play once instead of on every entry.
delaynumber0Seconds before the first part moves.
staggernumber0.045Seconds between parts.
durationnumber0.9Seconds each part takes.
easeEaseName | [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.
classNamestring–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.