Shimmer Text
betaText with a light band sweeping across it on a loop, or a blur-and-glide entrance as it arrives.
- Effects & motion
- 1 file
- 1 npm package
- Accessibility notes
Shipping soon
pnpm dlx @dowel-ui/cli add shimmer-textnpm packages installed: class-variance-authority.
import { ShimmerText } from "@/components/ui/shimmer-text";Default
Gallery
Once
Colours
On View
<ShimmerText>
| Prop | Type | Default |
|---|---|---|
asThe element to render. | ShimmerTextElement | "span" |
baseColorShine only: the text colour outside the band. Any CSS colour; use a token. | string | "var(--color-muted-foreground)" |
delayDelay before the first pass, in milliseconds. | number | 0 |
durationOne pass, in milliseconds. Defaults to 2500 for shine, 850 for sweep. | number | — |
ref | Ref<HTMLElement> | — |
repeat
| "loop" | "once" | "loop" |
repeatDelayShine only: the pause between sweeps, in milliseconds. | number | 600 |
shineColorShine only: the colour of the band. Any CSS colour; use a token. | string | "var(--color-foreground)" |
triggerOnViewWait until the text scrolls into view before playing. | boolean | false |
variant | "shine" | "sweep" | "shine" |
Plus every attribute of <span> except ref.
The text is never split, so it reads as one run and copies cleanly. The effect is decoration: under reduced motion the shine becomes plain text in the base colour and the entrance settles at once to its visible end state. In forced-colours mode the clipped gradient is dropped so the text takes the system colour. Pick base and shine colours that both meet contrast against the background.
7/7
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — does not apply
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes