Shimmer
Animated shimmer effect for text. Creates a gradient sweep animation.
Variants:
- "light" (default): muted foreground → muted highlight (dark text on light bg)
- "dark": gray-400 → foreground (darker sweep on light bg)
- "inverted": white text on dark backgrounds
Usage
import { Shimmer, ShimmerProps, ShimmerVariant } from "@desk/ui/components/shimmer";Best practices
Reach for
Shimmerfor in-progress *text* (a "Thinking…"/"Analyzing" sweep);Shineis an occasional attention flick on a surface, andSkeletonis a layout-shaped content placeholder.childrenmust be a plain string — the sweep is abg-clip-textgradient sized from character count, so element children won't clip correctly.Needs
ReducedMotionProvider; for finite "thinking" states setrepeat(e.g.repeat={2}) rather than leaving the default infinite loop running.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| as | ElementType | HTML element or component to render as. Defaults to "span" | |
| children | string | Text content to apply shimmer effect to | |
| className | string | Additional CSS classes | |
| duration | number | Animation duration in seconds. Defaults to 1.2 | |
| repeat | number | Number of times to repeat the animation. Defaults to Infinity | |
| repeatDelay | number | Delay between repeats in seconds. Defaults to 0 | |
| spread | number | Spread of shimmer gradient in pixels per character. Defaults to 2.5 | |
| variant | ShimmerVariant | Color variant. Defaults to "light" |
Also exports
- interface
ShimmerProps - type
ShimmerVariant
Composition
Used by