Dot field
Playground
Shape
Colour
Pointer
Install
npm install @shavin/fximport { DotField } from "@shavin/fx";Works with
React
Client component; Next.js and any React 18+ app
Remotion
Frame-exact through FxTimeProvider or time
Radial
Component Source
import { DotField } from "@shavin/fx/dot-field";
<DotField shape="radial" className="h-72" />Sphere
Component Source
<DotField shape="sphere" density={1.2} dotSize={1.3} />Terrain
Component Source
<DotField shape="terrain" dotSize={1.4} speed={0.8} />Chevron, brand colour
Component Source
<DotField shape="chevron" color="brand" dotSize={2} />Layers
Component Source
<DotField shape="layers" dotSize={1.4} />Cloud
Component Source
<DotField shape="cloud" dotSize={1.2} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| shape | "radial" | "sphere" | "terrain" | "chevron" | "layers" | "cloud" | "morph" | "radial" | Arrangement of the dots. morph (words and icons) has its own page, Dot field morph. |
| targets | (string | { text: string } | { icon: string })[] | [] | For morph: the words or icons the dots cycle through. |
| interval | number | 3200 | For morph: ms each target holds before the next. |
| density | number | 1 | Dot count multiplier, 0.4 to 2. |
| dotSize | number | 1.6 | Base dot radius in CSS px. |
| speed | number | 1 | Animation speed multiplier. |
| interactive | boolean | true | Pointer pushes the rings aside, lifts the terrain, brightens the chevron, or turns the sphere, layers and cloud (mouse, touch and pen). Ignored under reduced motion. |
| color | FxColor | "fg" | Dot colour: a theme token (fg, brand, muted), any CSS colour or var(--token), or a { light, dark } pair. |
| tone | FxColor | — | Deprecated: use color. |
| grain | number | 0 | Film grain over the canvas, 0 to 0.3 (0 is off). |
| time | number | — | Controlled time in seconds (e.g. frame / fps in Remotion): draws exactly this moment, no clock of its own. Also read from FxTimeProvider. |