--- import DefaultLayout from '@shared/layouts/DefaultLayout.astro' import Card from '@ui/Card.astro' import CardBody from '@ui/CardBody.astro' import CardTitle from '@ui/CardTitle.astro' import CardSubtitle from '@ui/CardSubtitle.astro' import DocsLink from '@ui/DocsLink.astro' import TextShimmer from '@ui/TextShimmer.astro' import Avatar from '@ui/Avatar.astro' const labels = ['Thinking…', 'Generating a reply…', 'Searching the web…', 'Reading 3 files…'] const durations = ['1s', '2s', '4s'] ---
Basic Add .text-shimmer to a short label that reports work in progress.
{labels.map((label) => {label})}
With a loader Put an empty .text-shimmer-loader before the label. One element, a small spinner in the text color.
{ labels.map((label) => ( {label} )) } Thinking… Thinking…
Colors The text keeps its own color, so any text utility works.
Thinking… Thinking… Thinking… Thinking… Thinking…
Sizes The shimmer follows the font size.
Thinking… Thinking… Thinking… Thinking…
Speed Set --tblr-text-shimmer-duration to change the speed of one sweep.
{ durations.map((duration) => (
Thinking… {duration}
)) }
Contrast Set --tblr-text-shimmer-opacity to dim the text more or less between sweeps.
{ ['0.2', '0.4', '0.7'].map((opacity) => (
Thinking… {opacity}
)) }
In a chat A shimmering label stands in for the reply until it arrives.
Reading the file…