Shimmering Text

A status line with light sweeping across it, meaning the work it names is happening now.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/shimmering-text.json

Usage

import { ShimmeringText } from "@/components/ui/shimmering-text"

Examples

Default

Say what is happening, not that something is. The line ends in a still ellipsis while it runs, and holds still under reduced motion.

Thinking…

Steps

Feed it each real step as it happens; the old words sink out as the new ones rise in. active={false} settles the finished line to plain text. Never rotate made-up steps on a timer.

Searching your documents…

API Reference

PropTypeDefaultDescription
text*stringNoneWhat is happening, in a few words.
activebooleantruefalse settles to plain muted text with no sweep and no ellipsis, for a status that has finished.
ellipsisbooleantrueEnds the line in a still ellipsis while active. An ellipsis already on the text is never doubled.
elapsedbooleanfalseShows a quiet seconds count after the words once the wait passes 5 seconds. It does not reset when the words change.
align"start" | "center""start"Where the line sits in its parent, so changing words leave from the same place. Use center under a centred element.
durationnumberthe ambient role (2s)Length of one sweep, in seconds. Leave it unset so the sweep keeps the same clock as every other working loop.
delaynumber0Delay before the first sweep, in seconds.
repeatbooleantrueWhether the sweep loops.
repeatDelaynumber0Pause between sweeps, in seconds.
startOnViewbooleantrueStarts the sweep only once the line is on screen. Set false to start at once.
oncebooleanfalseWhen true, on-screen detection fires only the first time.
inViewMarginstringNoneMargin (rootMargin) for on-screen detection, e.g. "-100px".
spreadnumber2Band width per character, in pixels, so short and long lines sweep at the same softness.
colorstringNoneResting text color. Defaults to --muted-foreground.
shimmerColorstring | string[]var(--color-neutral-50)Color of the light at the band's center. Several colors blend across the band.
text*stringWhat is happening, in a few words.
activeboolean = truefalse settles to plain muted text with no sweep and no ellipsis, for a status that has finished.
ellipsisboolean = trueEnds the line in a still ellipsis while active. An ellipsis already on the text is never doubled.
elapsedboolean = falseShows a quiet seconds count after the words once the wait passes 5 seconds. It does not reset when the words change.
align"start" | "center" = "start"Where the line sits in its parent, so changing words leave from the same place. Use center under a centred element.
durationnumber = the ambient role (2s)Length of one sweep, in seconds. Leave it unset so the sweep keeps the same clock as every other working loop.
delaynumber = 0Delay before the first sweep, in seconds.
repeatboolean = trueWhether the sweep loops.
repeatDelaynumber = 0Pause between sweeps, in seconds.
startOnViewboolean = trueStarts the sweep only once the line is on screen. Set false to start at once.
onceboolean = falseWhen true, on-screen detection fires only the first time.
inViewMarginstringMargin (rootMargin) for on-screen detection, e.g. "-100px".
spreadnumber = 2Band width per character, in pixels, so short and long lines sweep at the same softness.
colorstringResting text color. Defaults to --muted-foreground.
shimmerColorstring | string[] = var(--color-neutral-50)Color of the light at the band's center. Several colors blend across the band.