Text with a glint of light that runs across its letters.
Installation
Usage
import { ShimmeringText } from '@animate-ui/react/primitives/texts/shimmering';
export function Loading() {
return <ShimmeringText text="Thinking…" />;
}Animation
- Each letter pulses from
colortoshimmeringColorand back overduration(ease-in-out), one after the other (duration / lettersapart), the loop pausing0.05s × lettersbetween runs.wavealso lifts each letter as the glint passes (5px right and up, 1.1× scale, 15° turn). - Emoji and accented letters stay whole.
- The shimmer pauses off screen and in a hidden tab.
<AnimateUIProvider tempo>paces the loop.- Under reduced motion, the text holds still in its
color. - Screen readers read the text once, not letter by letter.
API Reference
ShimmeringText
| Prop | Type | Default |
|---|---|---|
text | string | - |
duration? | number | 1 |
wave? | boolean | false |
color? | string | 'var(--color-neutral-500)' |
shimmeringColor? | string | 'var(--color-neutral-300)' |
transition? | Transition | - |
...props? | Omit<HTMLMotionProps<'span'>, 'children'> | - |