Dot Matrix

A dot-matrix loader. A light runs a 5×5 grid of dots in a spiral, from the edge into the center, trailing a fading tail, then around again. For a boot screen or a panel's first load, where a spinner would be too small to carry the wait.

Koala OS

Field unit 4.2

  1. LINKEstablishing secure channel…
  2. AUTHVerifying credentials–
  3. SYNCSyncing records–
  4. UNITRegistering mobile unit–

Installation#

# One-time setup (tokens + lib helpers)npx koalaui-cli@latest init# Add this component (its dependencies come along)npx koalaui-cli@latest add dot-matrix

Usage#

usage.tsxTSX
import { DotMatrix } from "@/components/ui/dot-matrix"export function Example() {  return <DotMatrix />}

Anatomy#

import { DotMatrix } from "@/components/ui/dot-matrix"<DotMatrix />

Sizes#

xl (the default) is 64px, for a whole screen: a boot, a first load. lg is 36px, for a panel or a block inside a page. Both draw a 5px dot; the size sets the spacing.

lg · 36px
xl · 64px

Color#

The dots paint currentColor, so the matrix takes the text color around it, or any text-* you give it. The tail is opacity on that one color, so it reads on every ground in every theme.

In a panel#

The matrix is a status named "Loading". When words beside it already say what is loading, make those words the status and pass aria-hidden to the matrix: its role and name are dropped, so the wait is announced once.

Syncing records…

Speed#

A lap takes 1.1s. --dot-matrix-duration retimes it, on the matrix or on any container above it: slower for a calm, long wait, never so fast that the tail stops reading as a trail.

1.1s
2.4s

Reduced motion#

With prefers-reduced-motion, the light stops and the spiral stays drawn: each dot holds a still opacity that brightens along the path, faint at the edge and full at the center. It still reads as a loader, without moving. This is that state:

API reference#

DotMatrix

A <div> with role="status", holding 25 dots. Every div prop but children is forwarded; className is merged last and color comes from currentColor. The motion is the animate-dot-matrix token.

PropTypeDefaultDescription
size"lg" | "xl""xl"lg (36px) sits in a panel or a block; xl (64px) holds a whole screen.
labelstring"Loading"The accessible name while it is announced. Ignored under aria-hidden.
aria-hiddenboolean-Drops the role and the name, for a host that already says it is busy.
Data attributeDescription
data-slot"dot-matrix" on the root, "dot-matrix-dot" on each dot.
CSS variableDescription
--dot-matrix-durationRetimes the animate-dot-matrix loop (default 1.1s).
--dot-phaseSet on each dot: its place on the spiral, as the delay into the loop.
--dot-restSet on each dot: its still opacity under reduced motion, brighter along the spiral.

FAQ#

Spinner is the inline glyph: in a button, an input, a badge, sized by its host. Dot Matrix is a centerpiece for a wait that owns the space: a boot screen, an empty panel's first load.