GradientSpin

A zero-dependency matrix loader swept by a gradient wavefront.

Installation

Basic

Syncing workspacePreparing the latest changes

Gradient and pattern

Every cell shares one opacity-only CSS keyframe. Negative delays place the wave in steady state on first paint, while OKLab sampling keeps multi-stop gradients vivid.

API Reference

PropTypeDefaultDescription
gradientGradientPresetName | readonly GradientStop[]"sunrise"Built-in palette or custom positioned hex color stops.
pattern"arrow-up" | "diagonal" | "snake" | "ripple""arrow-up"Wavefront path across the cell matrix.
rowsnumber3Number of rows in the matrix.
colsnumber3Number of columns in the matrix.
cellSizenumber4Cell edge length in pixels.
cellGapnumber2Gap between cells in pixels.
cellRadiusnumber1Cell corner radius in pixels.
periodnumber750Duration of one wave sweep in milliseconds.
dimnumber0.1Resting opacity outside the active wavefront.
colorBy"row" | "path""row"Maps the gradient top-to-bottom or along the wave path.
labelstring"Loading"Accessible label announced for the status indicator.
respectReducedMotionbooleantrueFreezes cells to a static mid-state when reduced motion is requested.

Credits

GradientSpin is adapted from gradient-spin by ziye (@mona_biasia). The original source is MIT licensed; its copyright and license notice are preserved in the component source.