Skip to content

Contour Field

Slowly turning contour lines respond to the 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 ContourField from "./ContourField";
export default function Example() {
return (
<ContourField
color={"#bbabce"}
background={"#19161e"}
lines={24}
spacing={12}
speed={24}
lineWidth={0.9}
interactive={true}
children={"Off the map."}
minHeight={400}
style={{
"fontSize": 40,
"letterSpacing": "-.05em",
"color": "#eee6f3"
}}
/>
);
}

Using Contour Field

Use Contour Field behind a heading or as a section background. lines and spacing change the density of the contour pattern.

Turn interactive off when pointer movement would distract from nearby controls. Keep lineWidth low for a fine cartographic appearance.

Props

NameTypeRequiredDefaultDescription
colorstringNo"#bbabce"Contour stroke colour.
backgroundstringNo"#19161e"Container background.
linesnumberNo22Number of contours, clamped from 3 to 45.
spacingnumberNo12Distance between contour radii in SVG units.
speednumberNo24Duration of each drifting cycle in seconds.
lineWidthnumberNo0.8Contour stroke width.
interactivebooleanNotrueLet the field follow the pointer with a slight offset.
childrenReactNodeNoundefinedOptional foreground React content.
minHeightnumber | stringNo380Minimum 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.