Updated
Tracking In
Customize
Left
Left to right
Spacing1.3em
Duration1.10s
Stagger0.60s
Line stagger0.14s
Jitter0.25
Text size48px
Installation
npx shadcn@latest add https://uibrik.com/r/tracking-in.jsonAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/tracking-in/tracking-in.tsx"use client"; import { useEffect, useLayoutEffect, useRef } from "react"; import { cn } from "@/lib/utils"; // Size comes from --text-effect-size (default 1.25rem, i.e. text-xl), so a // preview can enlarge the effect without changing the installed default. const SIZE = "text-[length:var(--text-effect-size,1.25rem)] leading-[1.2]"; const TEXT = `${SIZE} text-zinc-700 font-light dark:text-zinc-200`; // Quartic ease-out: each gap starts closing with intent, then glides shut // over a long, soft tail, so letters land instead of stopping. const easeOut = (p: number) => 1 - (1 - p) ** 4; // useLayoutEffect warns during server rendering; the effect only needs the DOM. const useIsoLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect; const reducedMotion = () => window.matchMedia("(prefers-reduced-motion: reduce)").matches; type Order = "wave" | "reverse" | "random"; export type TrackingInProps = { /** One entry per line. Long lines still wrap; each wrapped row closes on its own. */
Adds the files to
components/uibrik/tracking-in. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/tracking-in.Usage
import { TrackingIn } from "@/components/uibrik/tracking-in/tracking-in";const lines = ["Every letter", "finds its place", "and settles in."];<TrackingIn lines={lines} align="left" order="wave" spacing={1.3} duration={1.1} stagger={0.6} lineStagger={0.14} jitter={0.25} // play={0}/>Where to use Tracking In
Brand names and headlines
Letters closing their wide gaps one by one gives a cinematic title reveal.
Cinematic section titles
Tracking in suits film, luxury and editorial sites.
Fashion and luxury sites
Wide-spaced type settling into place echoes fashion branding.
Props
TrackingIn- lines
- Type string[]
- ["Every letter","finds its place","and settles in."]
- One entry per line.
- align
- Type "left" | "center" | "right"
- "left"
- Text alignment; lines tighten toward this edge.
- order
- Type "wave" | "reverse" | "random"
- "wave"
- Which gaps close first.
- spacing
- Type number
- 1.3
- Gap after every letter at the start.
- duration
- Type number
- 1.1
- Time for one gap to close.
- stagger
- Type number
- 0.6
- Time between the first and last gap of a line starting to close.
- lineStagger
- Type number
- 0.14
- Delay between lines.
- jitter
- Type number
- 0.25
- How far gaps drift from a strict wave. Ignored for Random.
- play
- Type number
- –
- Each change plays the effect again; 0 shows the resting text. Leave it out to play once when the text scrolls 40% up the screen.
- className
- Type string
- –
- Classes for the text block, e.g. size and colour.