A letter-by-letter wave of light crosses the text.
Installation
Install the packages
npm install @prequelui/react motion@prequelui/react reuses the primitive library your components already depend on.
Add the component
npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/shimmering-text.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/shimmering-text.json
Turn on the motion
npx @prequelui/cli@latest animate shimmering-textThe 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.
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.
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
| Prop | Type | Default |
|---|---|---|
| text | string | — |
| duration | number | 1 |
| wave | boolean | false |
| color | string | muted foreground |
| shimmeringColor | string | foreground |