How to build an accessible ShimmerText in React

Purely visual: the text stays real text, so it is read normally and never announced on its own. The sweep runs only under prefers-reduced-motion: no-preference (otherwise plain muted text), and forced colours render it as CanvasText. The highlight band is the AI hue, which clears AA on every shipped theme and is never weaker than the muted base it sweeps over, so the sweep never lowers contrast

When to use a ShimmerText

When not to use it

Accessibility

Role none, verified at WCAG 2.2-AA.

Common mistakes

Avoid: <ShimmerText>Done</ShimmerText> left in place after the work finishes

Prefer: Render plain text once the work completes

The shimmer means "in progress"; leaving it on a finished label tells the reader something is still happening

Example

<ShimmerText>Thinking…</ShimmerText>

See the full ShimmerText reference →