SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

shimmer

Sweeping highlight band for an indeterminate progress fill, resolved entirely to @keyframes so it runs from server-rendered markup and settles once the gate clears.

tsx
import { shimmer } from "@sdxc/ui/animations";

Signature

typescript
shimmer<Node extends Element = Element>(options?: Shimmer.Options): Mixin<Node>

Returns a @sdxc/u mixin ready for a progress indicator's fill element.

Parameters

ParameterTypeDefaultRequiredDescription
optionsShimmer.Options—NoTiming, band width, and gating for the loop.

Examples

tsx
<ProgressBar.Indicator mix={[shimmer()]} />

The events, constants and types its module publishes, each imported from @sdxc/ui/animations too.

Interface

Shimmer.Options

Tuning for a shimmer loop: timing, highlight width, and the platform state it runs under.

MemberTypeDefaultRequiredDescription
durationstring—NoLength of one sweep across the band, as a CSS time. Defaults to DEFAULT_SHIMMER_DURATION.
easingstring—NoCSS easing function driving the sweep. Defaults to DEFAULT_SHIMMER_EASING.
bandSizestring—NoWidth of the moving highlight band, as a CSS length or percentage. Defaults to DEFAULT_SHIMMER_BAND_SIZE.
outsideGate"hidden" | "visible"—NoWhat the host looks like outside the gate. "hidden" suits an element that exists only as a loading cue; "visible" keeps an element that carries its own content legible once the loop settles. Defaults to "hidden".
whenstring—NoSelector fragment, relative to the host, that gates the loop. Defaults to DEFAULT_SHIMMER_WHEN; pass a custom fragment (e.g. [data-indeterminate="true"]) for a hand-built progress indicator.
@sdxc/ui

Can’t find it? Contact us