Signature
Text shimmer
A light sweep across loading text.
Thinking label
A soft band of light sweeps across muted text while work is in progress. Set active={false} when it finishes and the text settles into plain type.
Why did churn rise in October?
Thinking through 3 quarters of billing data…
When to use
- Short status labels for work of unknown length: “Thinking…”, “Searching 1,284 documents”, “Generating report”.
- A heading of a section that is still being produced.
Not for: content placeholders (use a skeleton), progress you can measure (use a progress bar), or body text people need to read — the moving band lowers contrast for a moment.
Headings, inline text and speed
asChild puts the shimmer on your own element, such as a heading. duration sets one sweep in milliseconds. Colours come from --ui-text-shimmer-base and --ui-text-shimmer-highlight.
Generating your Q4 report
Searching 1,284 documents
Syncing with Google Calendar — slower sweep
API
TextShimmer
| Prop | Type | Default | Description |
|---|---|---|---|
| active | boolean | true | Run the sweep. False shows plain text in the inherited colour. |
| duration | number | 2000 | One sweep, in milliseconds. |
| asChild | boolean | false | Render the child element (a heading, a paragraph) with the shimmer. |
| ...props | HTMLAttributes<HTMLSpanElement> | — | Forwarded to the <span>, including ref and className. |
CSS variables
| Prop | Type | Default | Description |
|---|---|---|---|
| --ui-text-shimmer-base | color | var(--ui-muted-foreground) | Resting text colour. |
| --ui-text-shimmer-highlight | color | var(--ui-foreground) | Colour at the centre of the band. |
| --ui-text-shimmer-band | percentage | 10% | Half-width of the band, as a share of the gradient. |
| --ui-text-shimmer-duration | time | 2s | Set by the duration prop. |
Server Component–safe: no JavaScript runs. In plain HTML: <span class="ui-text-shimmer" data-state="active">.
Accessibility
- The text stays real text: selectable, translatable and read normally by screen readers.
- It announces nothing by itself. When the label is the news, put it in a
role="status"region, as in the first example. - The resting colour is the muted foreground, which meets 4.5:1 on the page background; the band only ever brightens it.
Motion
- One linear sweep, left to right (right to left in RTL), every 2s by default, looping while active.
- Pure CSS: a gradient clipped to the glyphs with background-clip: text, moved with background-position.
- Reduced motion: the band is removed and the text rests in the muted colour.