Ballmac UI home

Shimmer Text

Text with a band of light sweeping across it, from muted to full foreground color. Suited to AI "thinking" and loading status lines; static under reduced motion.

Thinking…

Reading 3 files in src/billing

Installation

$ pnpm dlx shadcn@latest add @ballmac/shimmer-text

Usage

import { ShimmerText } from "@/components/ballmac/shimmer-text"

The full example is in the Code tab above.

API reference

PropTypeDefault
as

The element to render. Defaults to "span".

ShimmerTextElement"span"
duration

Seconds for one sweep across the text.

number2
spread

Half-width of the highlight in em, so it scales with the font size.

number2

Also accepts the standard attributes of its root element.

Use with AI

Wrap short text: <ShimmerText>Thinking…</ShimmerText>. The base color is --muted-foreground, so the text stays readable at every frame; the sweep brightens it to --foreground. In forced-colors mode it falls back to plain system text. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Shimmer Text (@ballmac/shimmer-text) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • An AI assistant's "Thinking…" or "Searching the docs…" line while a response streams
  • Inline pending states such as "Deploying…" or "Indexing 1,204 files"
  • A subtle accent on a short marketing label

Not for

  • Paragraphs or long text (the sweep becomes distracting)
  • The only signal that something is loading; pair it with aria-live or a spinner's label for screen readers

Registry JSON: https://ui.ballmac.com/r/shimmer-text.json

Credits

Free to use in personal and commercial projects.

Registry
shadcn/utils