Skip to content
Textlab
1
Browse

ComponentsLight

Shimmer text

A calm light passes across the words.

Generating a reply

Installation

$ npx shadcn@latest add @textlab/shimmer-text

Needs @textlab in your components.json. Setup takes a minute.

Usage

usage.tsx
import { ShimmerText } from "@/components/textlab/shimmer-text/shimmer-text";

<ShimmerText text="Thinking" />

Variants

subtlebrightrainbow

Props

PropTypeDefaultDescription
text*string–The copy.
variant"subtle" | "bright" | "rainbow""subtle"A soft pass for status lines, a crisp sheen, or a hint of color.
speednumber2.4Seconds per pass, including the rest after it.
spreadnumber0.18Width of the light band as a share of the text.
asElementType"span"Rendered element.
reducedMotion"user" | "always" | "never""user"user follows the OS setting; always shows the still version.
classNamestring–Merged onto the root.

When to use it

Reach for it

  • Loading, thinking and generating states.
  • Placeholders that should feel alive while content arrives.

Skip it

  • Headings that are already loaded; the motion implies work in progress.
  • Error or success messages.

Accessibility and motion

Accessibility

  • Plain, unsplit text. Pair it with aria-busy on the region that is loading.

Motion

  • The light crosses in the first 70% of each cycle, then rests, so it never feels frantic.
Reduced motion. The text shows at a steady, slightly muted color.

Performance

  • One CSS animation on background position.