# Shimmer

Show that a short text label describes work still in progress.

## Preview

shimmer-preview-1.jsx

```jsx
import { Shimmer } from "@/components/ui/shimmer";

export default function Example() {
  return (
    <p>
      <Shimmer>Checking the deployment plan</Shimmer>
    </p>
  );
}

```

## Design guidance

Use Shimmer for a short label that describes actual work. Keep Loader for a separate activity indicator. Shimmer does not own a live region, a timer or progress. Reduced motion and forced colors use static readable text.

## Installation

```sh
npx shadcn@latest add https://ghost-ui.com/r/shimmer.json
```

## Basic usage

```tsx
import { Shimmer } from "@/components/ui/shimmer";

export function ShimmerExample() {
  return <Shimmer>Reviewing the release…</Shimmer>;
}
```

## Structures

Shimmer is one span. Its default variant sweeps a narrow highlight; variant="gradient" sweeps a shared indigo, violet, purple and fuchsia text gradient. Both use background-clip: text; reduced motion and forced colors show static readable text. ActivityLine selects the gradient for active first-level rows and the default sweep for active nested rows; row glyphs and metadata stay solid. The sweep covers one tile per cycle, so the loop has no jump. Tilt either sweep with angle; recolor either variant with --shimmer-base, --shimmer-highlight, or a full --shimmer-image; size the default band with --shimmer-spread (default 10%); time it with --shimmer-duration. Pair text Ellipsis inside Shimmer for a pending label; keep object dots beside it, since solid marks cannot take a text clip.

## Examples

### Settled text

Set active={false} when the work settles.

shimmer-settled-text-2.jsx

```jsx
import { Shimmer } from "@/components/ui/shimmer";

export default function Example() {
  return (
    <p>
      <Shimmer active={false}>The answer is ready</Shimmer>
    </p>
  );
}

```

### Motion preference

This uses the browser's actual reduced-motion preference. It does not simulate a user setting.

shimmer-motion-preference-3.jsx

```jsx
import { Shimmer } from "@/components/ui/shimmer";

export default function Example() {
  return (
    <p>
      <Shimmer>Checking the deployment plan</Shimmer>
    </p>
  );
}

```

### Angle and color

#### Band angle

Tilt the band with angle.

shimmer-band-angle-4.jsx

```jsx
import { Shimmer } from "@/components/ui/shimmer";

export default function Example() {
  return (
    <p>
      <Shimmer angle={20}>Backfilling the search index</Shimmer>
    </p>
  );
}

```

#### Single color

Apply one highlight color to the band.

shimmer-single-color-5.jsx

```jsx
import { Shimmer } from "@/components/ui/shimmer";

export default function Example() {
  return (
    <p>
      <Shimmer
        style={{
          "--shimmer-highlight": "#378ADD",
        }}
      >
        Reading 4 files
      </Shimmer>
    </p>
  );
}

```

#### Gradient variant

Use the shared purple gradient across the text.

shimmer-gradient-variant-6.jsx

```jsx
import { Shimmer } from "@/components/ui/shimmer";

export default function Example() {
  return (
    <p>
      <Shimmer variant="gradient">Polishing the release notes</Shimmer>
    </p>
  );
}

```

### Pending label with ellipsis

Compose text Ellipsis inside Shimmer for a live pending label. Object dots sit beside the sweep instead.

shimmer-pending-label-with-ellipsis-7.jsx

```jsx
import { Shimmer } from "@/components/ui/shimmer";
import { Ellipsis } from "@/components/ui/loader";

export default function Example() {
  return (
    <p>
      <Shimmer>
        Generating response
        <Ellipsis />
      </Shimmer>
    </p>
  );
}

```

## API reference

Shimmer properties

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| active | boolean | true | Enables the text sweep; false preserves static text. |
| variant | "default" \| "gradient" | "default" | Use the normal highlight sweep or the shared purple gradient. |
| duration | string | 2.4s | Optional CSS animation duration. |
| angle | number | 100 | Tilt of the text sweep in degrees. |
| --shimmer-base / --shimmer-highlight / --shimmer-image / --shimmer-spread | CSS variables | — | Recolor the sweep, replace its image, or set the default band half-width (10%). |
| Native span props / ref | HTMLAttributes<HTMLSpanElement> | — | Preserves caller text, selection and semantics. |
