Skip to content

Dot Field

A field of dots that parts and brightens around your pointer.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import DotField from "./DotField";
export default function Example() {
return (
<DotField
color={"#887e9c"}
activeColor={"#f1bd98"}
background={"#131019"}
spacing={20}
dotSize={1.5}
radius={150}
strength={32}
speed={0.6}
minHeight={420}
/>
);
}

Using Dot Field

Use spacing and dotSize together to balance density and contrast. minHeight defines the area in which the dot field responds.

radius changes the pointer's area of influence, while strength changes how far dots move. Start with a modest strength behind readable foreground content.

Props

NameTypeRequiredDefaultDescription
colorstringNo"#77708d"Resting dot colour.
activeColorstringNo"#edbb98"Dot colour inside the pointer radius.
backgroundstringNo"#131019"CSS background behind the dots.
spacingnumberNo22Distance between dots in pixels; very large canvases use a capped dot count.
dotSizenumberNo1.4Dot radius in pixels.
radiusnumberNo150Pointer influence radius in pixels.
strengthnumberNo28Maximum displacement in pixels.
speednumberNo.6Idle wave speed; 0 keeps the wave still.
minHeightnumber | stringNo340Minimum height in pixels or a CSS length. The component can fill a taller parent.
classNamestringNo""Additional CSS classes, merged with the component styles.
styleCSSPropertiesNoundefinedInline styles for caller-defined sizing and visual overrides.

Related components

Lava Lamp

Backgrounds

Warm liquid forms merge and drift inside a softly lit glass lamp.

Helix Field

Backgrounds

Two strands of shaded particles rotate around fine connecting rungs.

Wave Lattice

Backgrounds

A fine perspective mesh drifts over a sculpted wave surface.

Kinetic Mobile

Backgrounds

Suspended discs, rings and counterweights sway on fine connecting rods.