Matrix loader
Playground
Pattern
Colour
Install
npm install @shavin/fximport { MatrixLoader } from "@shavin/fx";Works with
React
Client component; Next.js and any React 18+ app
Remotion
Frame-exact through FxTimeProvider or time
Patterns
wave
snake
ripple
rain
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| pattern | "wave" | "snake" | "ripple" | "rain" | "wave" | How the light moves: "wave" sweeps a diagonal band, "snake" runs a lit tail row by row, "ripple" spreads rings from the centre, "rain" drips each column at its own pace. |
| grid | number | 3 | Dots per side, rounded and clamped to 3 to 7. |
| size | number | 24 | Width and height in px. |
| speed | number | 1 | Speed multiplier. |
| dotSize | number | 1 | Dot size multiplier. |
| label | string | "Loading" | Accessible name. Pass "" when a visible label sits beside it. |
| color | "fg" | "brand" | "muted" | string | { light: string; dark: string } | - | Colour of the dots: a theme token, any CSS colour or var(--token), or a { light, dark } pair. Sets the root's CSS color; without it the dots use currentColor. |
| className | string | - | A text colour class (e.g. text-success) also colours the dots when color is unset (default the brand-contrast text colour). |
| time | number | - | Controlled time in seconds (e.g. frame / fps in Remotion): the loader draws that moment and runs no clock of its own. Also read from FxTimeProvider. |
Anatomy
import { MatrixLoader } from "@shavin/fx";
<MatrixLoader />
<MatrixLoader pattern="snake" grid={4} size={20} color="fg" />