GitHub

Text shimmer

A shimmer sweep across label text for premium loading states.

TextShimmer sweeps a highlight across a line of text. It feels more polished than dots or blinking, so it is a good fit for generated summaries, AI copy, document scanning, and premium-feeling loading labels.

Thinking

import { TextShimmer } from "@/components/loading-ui/text-shimmer";

export function TextShimmerDemo() {

Installation

pnpm dlx shadcn@latest add @loading-ui/text-shimmer

Usage

import { TextShimmer } from "@/components/loading-ui/text-shimmer";
<TextShimmer>Thinking</TextShimmer>

Customization

TextShimmer uses a text-clipped gradient. Keep the copy short enough that the sweep reads as progress instead of becoming a decorative headline.

Color

By default, TextShimmer derives both colors from currentColor, so it follows filled buttons, badges, and muted text automatically. Use baseColor and shimmerColor directly when you need explicit swatches.

Scanning document

Preparing export

Retrying upload

import { TextShimmer } from "@/components/loading-ui/text-shimmer";

export function TextShimmerColor() {

Duration

Longer copy usually benefits from a slightly slower sweep.

Fast scan

Generating summary

Slow background read

import { TextShimmer } from "@/components/loading-ui/text-shimmer";

export function TextShimmerDuration() {

Spread

spread controls how wide the bright part of the sweep becomes.

Narrow highlight

Default highlight

Broad highlight

import { TextShimmer } from "@/components/loading-ui/text-shimmer";

export function TextShimmerSpread() {

Examples

These examples use shimmer where the text itself is the loading surface: generated labels, assistant copy, and scan states.

Button

Inside filled buttons, the shimmer follows the button foreground automatically.

import { Button } from "@/components/ui/button";
import { TextShimmer } from "@/components/loading-ui/text-shimmer";

Badge

Shimmer badges are useful for generated or indexing states without adding a separate icon.

GeneratingIndexingSummarizing
import { Badge } from "@/components/ui/badge";
import { TextShimmer } from "@/components/loading-ui/text-shimmer";

Input Group

Input addons can show that a prompt, query, or answer is being assembled.

Reading index
Drafting answer
import {
  InputGroup,
  InputGroupAddon,

Alert

Use alerts when the shimmer headline needs supporting context.

import {
  Alert,
  AlertDescription,