Text Animations

Metallic Text

Chrome poured into a headline — a metal ramp clipped to real glyphs, a specular travelling across them, and a tinted wake following a beat behind.

Install

bun add clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/metallic-text/metallic-text.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
sweepSpeednumber3.2Time for the highlight to cross the line once.
sweepWidthnumber0.28Width of the specular band as a share of the text box. Narrow reads as polished chrome, wide as brushed steel — the band is the light source, so its size is the softness of the reflection.
sweepAnglenumber18Rake of the band off vertical. Stops short of ±90 on purpose: at a right angle the band lies parallel to its own travel and the sweep stops reading as movement at all.
contrastnumber0.7Separation between the dark and light bands of the metal. This is what decides whether the text reads as chrome or as a grey gradient — the horizon between the two is the reflection of a ground plane.
specularnumber0.85Brightness of the travelling highlight.
lagnumber0.35How far the wake trails the highlight. At zero the two move as one gradient; raise it and the light gains weight, because the trailing edge is still arriving when the leading edge has gone.
sweep"alternate" | "loop""alternate"Whether the light returns the way it came or restarts from the same edge each pass.
grainnumber0.12Brushed striations along the sweep axis. Directional rather than random — milled metal has a grain direction, and noise reads as dirt on the screen instead.
baseColorstring (hex)"#8f94a3"The metal. Also the fallback colour: where background-clip on text is unsupported the element renders as plain text in this colour rather than as an invisible headline.
highlightColorstring (hex)"#ffffff"The specular.
accentColorstring (hex)"#a855f7"Tint of the wake.

What It Demonstrates

Mask
Hiding or revealing parts of an element using a shape or gradient — like clip-path, but with soft, fadeable edges.
Compositing
Letting the GPU move or fade an element on its own layer without redoing layout or paint.
Follow-through
Parts of an element keep moving and settle slightly after the main motion stops, adding weight.
Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.
Loop
An animation that repeats, a set number of times or infinitely.

Related Components

Appears In