Shimmer
Words with a light band sweeping across them, for "Thinking…" or "Generating…" while something is being worked on.

No script: one CSS utility, shimmer, behind motion-safe:.
Use it
<div role="status">
<x-ds::shimmer>Thinking…</x-ds::shimmer>
</div>
as picks the element, for a paragraph or a heading:
<x-ds::shimmer as="p" class="text-body">Generating a summary of 14 documents</x-ds::shimmer>
On an element of your own, write the utility with its still colour:
<span class="text-fg-muted motion-safe:shimmer">Searching…</span>
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
as | span p div strong small h2 h3 h4 li dt dd | span | The element it renders. Anything else is a span. |
Pair it with a status
The shimmer says nothing to a screen reader. It is the text it wraps, and
the text appearing is only announced from inside a live region. Put it, or the
thing it sits in, inside role="status", which is polite:
<div role="status">
@if ($answer)
{{ $answer }}
@else
<x-ds::shimmer>Thinking…</x-ds::shimmer>
@endif
</div>
A loader beside it is a status of its own; put it outside this region, or use one or the other.
Render that region before the words go into it, as with the toast region: a live region only announces what changes after it is on the page. When the work is done, replace the words with the result (or with "Done"), so the status ends as well as starts.
Motion
The text is painted by its background, clipped to the letters: a muted ground with the foreground colour as a band crossing it every two seconds, in both themes from the colour tokens. With reduced motion the utility does not apply and the words are the muted colour, still. Right-to-left text sweeps the other way.
Don't
- Don't shimmer a whole paragraph of real content. It is for a short label about the wait, never for text someone has to read.
- Don't use it as the only sign that something is happening. The words do that; the shimmer only makes them look alive.
- Don't put a link in it. The link's colour is painted over.
More in specs/shimmer.md.
From the package repo: edit this page on GitHub.