ui-kit0.0

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

PropTypeDefaultDescription
activebooleantrueRun the sweep. False shows plain text in the inherited colour.
durationnumber2000One sweep, in milliseconds.
asChildbooleanfalseRender the child element (a heading, a paragraph) with the shimmer.
...propsHTMLAttributes<HTMLSpanElement>—Forwarded to the <span>, including ref and className.

CSS variables

PropTypeDefaultDescription
--ui-text-shimmer-basecolorvar(--ui-muted-foreground)Resting text colour.
--ui-text-shimmer-highlightcolorvar(--ui-foreground)Colour at the centre of the band.
--ui-text-shimmer-bandpercentage10%Half-width of the band, as a share of the gradient.
--ui-text-shimmer-durationtime2sSet 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.