All 34 built-in patterns by kind, what each one is for, which ones read value, and how to start your own pattern from one.
Engine · 4 min read
The engine ships 34 patterns. Pass a name to pattern. Each one works on every layout.
<DotMatrix pattern="spinner" lattice="circle" size={20} />Loaders
Loops for a wait of unknown length.
| Pattern | What it draws | Loop |
|---|---|---|
orbit (default) | Two dots that circle the middle, with trails | 1.4s |
spinner | An arc that grows and shrinks as it turns, like a native spinner | 1.6s |
pulse | Two rings that ripple out from the middle | 1.8s |
breathe | A disc that grows, glows and shrinks | 2.4s |
scan | A bar that sweeps left and right, with a trail | 1.8s |
radar | A beam that turns, with a fading wedge behind it | 2.0s |
spiral | A dot that winds in along a spiral and back out | 2.2s |
bounce | A ball that drops, squashes on the floor and springs up | 1.1s |
equalizer | Bars that jump to a beat | 1.6s |
typing | Three dots that hop in turn, like someone typing | 1.4s |
snake | A comet that runs round the edge | 2.4s |
helix | Two strands that twist round each other | 2.0s |
heartbeat | A heartbeat trace that runs across | 1.8s |
Progress
These patterns show an amount. All but fill read the value prop, from 0 to 1.
| Pattern | What it draws | Reads value |
|---|---|---|
progress | A bar that fills from the left, with a faint shimmer | Yes, in 33 steps |
progressRing | A ring that closes as the value rises | Yes, in 33 steps |
voice | Bars from the middle out that follow a sound level | Yes, in 9 steps |
fill | A liquid that fills up with a rolling surface, then drains | No: it loops |
<DotMatrix pattern="progress" lattice="bar" value={uploaded / total} />
<DotMatrix pattern="voice" lattice="capsule" value={micLevel} />Results
These play one time and hold the last frame. Use them when work ends.
| Pattern | What it draws | Screen reader hears |
|---|---|---|
check | A check mark that draws itself, then glows | "Done" |
cross | A cross that draws its two strokes, then shakes once | "Something went wrong" |
Loading states shows how to switch from a loader to a result.
Effects
Ambient motion for a backdrop, a hero or a status line.
| Pattern | What it draws | Loop |
|---|---|---|
wave | A sine wave that rolls across | 1.8s |
rain | Drops that fall with trails | 1.6s |
sparkle | Random dots that blink | 2.4s |
plasma | Soft noise that flows | 4.0s |
metaballs | Three blobs that drift and melt together | 3.2s |
forms | A circle that turns into a square, a triangle, a star, and back | 4.8s |
ripple | Rings on water, fading out from the middle | 2.0s |
marquee | "LOADING" running across in a 5 × 7 dot font | 4.0s |
swell | Ripples where each dot grows as the crest passes (the scale channel) | 2.0s |
confetti | Sparks that turn as they fly out (the angle channel) | 2.4s |
spectrum | A wave that runs through a palette (the tint channel) | 3.0s |
spectrum is the only built-in pattern that uses look.colors. See Colors.
Simulations
Rules that step a whole board. They look best on large grids.
| Pattern | What it runs | Loop |
|---|---|---|
life | Conway's Game of Life | 4.0s |
sand | Sand that pours, piles up and drains | 4.0s |
flock | Six birds that flock together | 4.0s |
reaction | Gray-Scott reaction-diffusion | 5.0s |
How many dots a pattern uses
By default a pattern uses at most 9 dots along the height. plasma, ripple and the four simulations use up to 13, because they need more dots to read. Set look.grid for another number. See Layouts and dots.
Start from a built-in
Every built-in is a scene. DOT_MATRIX_PATTERNS holds them by name. Copy one and change what you need:
import { DOT_MATRIX_PATTERNS } from "@/components/ui/dot-matrix/dot-matrix-patterns";
import type { ScenePattern } from "@/components/ui/dot-matrix/dot-matrix-scene";
const slowRadar: ScenePattern = { ...DOT_MATRIX_PATTERNS.radar, duration: 4000 };
<DotMatrix pattern={slowRadar} lattice="circle" />;Define the scene outside the component. The engine knows a scene by its object, so a new object on each render bakes the pattern again. Write a pattern explains the scene language.