Skip to content

Dot Matrix

Free

A grid of small cells that light up in a pattern while something loads, and turn into a check or an x when the work ends.

  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Import Dot Matrix and compose its parts.

dot-matrix.tsx

DotMatrix

<output>
PropTypeDefaultDescription
rounded"default""full"—
size"default""lg""sm""xl""xs"—
pattern"border""checker""columns""converge""corners""fill""heartbeat""pulse""radar""rain""ripple""scan""snake""spiral""twinkle""wave""twinkle"How the cells light up. Default twinkle.
grid3453Cells on each side: 3 (default), 4, or 5.
state"done""error""paused""running""running"running (default) loops; paused holds the frame at 40%; done and error turn the cells into a check or an x, in the same color (add text-success or text-destructive for color).
speednumber1Loop speed: 2 is twice as fast. Default 1 (one loop in 1.6s, the flow kind).
colorsreadonly string[]—The colors of the cells, as gradient stops: any CSS color, a token too (var(--color-info)). One color paints every cell. Default: the text color.
gradient"diagonal""horizontal""radial""vertical""diagonal"How the colors lie over the cells: diagonal (default), horizontal, vertical, radial.
...props<output> attributes—Every other attribute goes to the <output>, with a ref.
  • Pick one of the pattern values to match the feel of your product.
  • Set state to done or error when the work ends. Add text-success or text-destructive for color.
  • Name it with aria-label, or set aria-hidden when a text label is next to it.
  • Set colors to two or more colors for a gradient over the cells, and gradient for its direction.
  • For a plain loading ring in a button or a field, use a Spinner.
  • For a task with a known share done, use a Progress.
Loop
flow · one loop in 1.6s; only the opacity of each cell moves
End
fade · the cells turn into a check or an x from the light each cell shows
  1. AddedDot Matrix.
Open the release