Shimmering Text

A letter-by-letter wave of light crosses the text.

shimmering-text.tsx

Installation

1

Install the packages

npm install @prequelui/react motion

@prequelui/react reuses the primitive library your components already depend on.

2

Add the component

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/shimmering-text.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/shimmering-text.json

3

Turn on the motion

npx @prequelui/cli@latest animate shimmering-text

The CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.

Usage

Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.

shimmering-text.tsx
import { ShimmeringText } from "@/components/prequelui/shimmering-text";

export default function Demo() {
  return (
    <ShimmeringText
      text="Shimmering"
      duration={1}
      wave
      className="text-3xl font-medium"
    />
  );
}
import { ShimmeringText } from "@/components/prequelui/shimmering-text";

export function Variant() {
  return (
    <ShimmeringText tempo={1.2}>
      …
    </ShimmeringText>
  );
}

Animation

A band of light crosses the string letter by letter. Each letter follows the same opacity cycle with a delay proportional to its position, so the highlight travels instead of blinking; the wave option adds a small lift, scale and rotation.

  • Opacity cycle: 1 s ease-in-out per letter, looping.
  • Letter delay: index × duration ÷ letter count.
  • Repeat delay after a full pass: letter count × 50 ms.
  • Reduced motion holds the resting colour and no transform.
1 s loopopacity 1 → 0.35per-letter delaywave 5 px

API Reference

Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.

ShimmeringText

PropTypeDefault
textstring—
durationnumber1
wavebooleanfalse
colorstringmuted foreground
shimmeringColorstringforeground

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026