Contour Field
Fine ivory and sage topographic lines trace irregular basins over charcoal.
Install the component, then paste your configured usage. Your settings are included in the code below.
npx arclen-ui add contour-field --settings eyJ2YXJpYW50IjoiYmFzaW4iLCJkZW5zaXR5IjoxMCwic2NhbGUiOjAuODUsInNlZWQiOjE5LCJsaW5lV2VpZ2h0IjoxLjEsImludGVuc2l0eSI6MC44LCJiYWNrZ3JvdW5kQ29sb3IiOiIjMTExMzEwIiwibGluZUNvbG9yIjoiIzUwNTU0RCIsImFjY2VudENvbG9yIjoiIzdDODk3NSIsIndhcm1Db2xvciI6IiNCNkIyQTUiLCJwb2ludGVySW50ZXJhY3Rpb24iOnRydWUsInNwZWVkIjowLjI1LCJsYXlvdXQiOiJmaWxsIiwiaGVpZ2h0Ijo2MDB9import { ContourField } from "@/components/contour-field";
export default function Example() {
return <ContourField {...{
"variant": "basin",
"density": 10,
"scale": 0.85,
"seed": 19,
"lineWeight": 1.1,
"intensity": 0.8,
"backgroundColor": "#111310",
"lineColor": "#50554D",
"accentColor": "#7C8975",
"warmColor": "#B6B2A5",
"pointerInteraction": true,
"speed": 0.25,
"layout": "fill",
"height": 600
}} />;
}| Property | Type | Default |
|---|---|---|
variantComposition Nested, irregular Basin terrain. Options: basin (Basin) | select | "basin" |
densityContour density Elevation levels. Small containers reduce the count to preserve readable separation. 8–36Step 1 | number | 10 |
scaleField scale Larger values show more terrain in the same area. 0.6–1.8Step 0.05 | number | 0.85 |
seedTerrain seed Deterministic terrain. Fractional seeds are rounded down. 0–9999Step 1 | number | 19 |
lineWeightLine weight 0.5–1.8Step 0.05 | number | 1.1 |
intensityLine intensity 0.3–1.8Step 0.05 | number | 0.8 |
backgroundColorBackground Opaque six-digit hex color. | color | "#111310" |
lineColorQuiet contours Opaque six-digit hex color. | color | "#50554D" |
accentColorPrimary contours Opaque six-digit hex color. | color | "#7C8975" |
warmColorHighlight contours Opaque six-digit hex color. | color | "#B6B2A5" |
pointerInteractionPointer response Fine-pointer movement bends and highlights nearby contours. Touch does not trigger it. Pause and reduced motion freeze the response. | boolean | true |
speedSpeed 0 holds the current terrain. Motion resumes from that phase. 0–2Step 0.05 | number | 0.25 |
layoutSizing Options: fill (Fill parent), fixed (Fixed height) | select | "fill" |
heightHeight CSS pixels for Fixed height. Fill parent needs a parent with an explicit height. 160–1600Step 10 | number | 600 |
Contour Field draws fine elevation contours over a dark ground. Basin forms nested irregular islands and broad saddles. The default palette uses muted ivory and sage contours over charcoal. Defaults use 10 elevation levels, 0.85 field scale, 1.1 line weight, 0.8 intensity and 0.25 speed for a quiet, slow field.
Use
import {ContourField} from './contour-field/src/react';
<div style={{height: 560}}>
<ContourField variant="basin" />
</div>Fill parent is the default. Give the receiving parent an explicit height. For a self-sized section use layout="fixed" height={560}. Keep text, buttons and other content in a separate positioned sibling: this component is decorative and never receives keyboard focus. Fine-pointer movement bends and highlights nearby contours. Set pointerInteraction={false} to let pointer events pass through the field. Touch does not trigger the response.
The framework-neutral core exports defaults, resolveSettings, render and mount. render(settings) returns static SVG terrain plus its canvas. mount(host, settings) accepts an empty element or that server-rendered markup. It returns update(patch), pause(), resume() and destroy().
import {mount} from './contour-field/src/core';
import './contour-field/src/styles.css';
const terrain = mount(element, {variant: 'basin', layout: 'fixed', height: 480});
terrain.update({density: 30, seed: 84});
terrain.pause();
terrain.resume();
// Release observers, listeners and scheduled animation when the host leaves.
terrain.destroy();Appearance and motion
Density sets the elevation count. Basin spaces its elevations unequally: wider steps through the middle slopes and closer steps near high and low interiors. Small receivers automatically use fewer levels so lines remain separated. Scale changes how much terrain fits in the frame; line weight and intensity change stroke width and opacity. Quiet, primary and highlight contour colors are independent, opaque six-digit hex values.
The seed produces a deterministic composition. Fractional seeds are floored internally. Speed zero holds the current phase. Basin moves through a continuous volumetric field with a local domain warp. Basin uses irregular lobes and broad saddles, with primary color families around the middle elevations and highlight color continuing onto both neighboring contours near the peaks. Contour families use the configured colors directly, preserving muted saturation. Stroke weight and opacity distinguish major accents from neighboring contours; neutral contours have their own color. They do not use randomized per-frame displacement.
Pointer response follows movement with a short eased lag and fades when the pointer leaves. It works at speed zero while the terrain phase stays held. Explicit pause and reduced motion freeze pointer animation as well as the terrain.
The clock advances only while animated, visible and on screen. Pause/resume, document visibility, offscreen suspension and the operating system's reduced-motion preference preserve the phase. Setting paused on the React wrapper delegates to the same core. Explicit settings updates and resizes may draw a new static composition while paused.
Fallback and validation
Server-rendered HTML includes original static contour SVG. It remains visible without JavaScript or Canvas2D. The fallback uses a 720 by 450 composition cropped to the receiving box; the live canvas recomputes the field for the actual aspect ratio. Reduced motion retains a useful static canvas and schedules no continuous frames.
Settings come from the manifest. Invalid, unknown or out-of-bounds values throw before a live instance is changed. An invalid update leaves its previous state intact. Multiple instances have separate clocks, settings, canvases and observers. No IDs, network resources or document-wide selectors are needed.
The canvas and SVG are hidden from assistive technology because they are decorative. Put meaningful headings and interactive controls in the host page with their own accessible names and visible focus styles.
Rendering limits
Canvas work is capped at 30 paints per second. The terrain sampling grid is capped at 192 by 120 cells, reduced to 160 by 100 above density 24; contour elevations are interpolated within those cells. The canvas uses at most DPR 2 and approximately 3.2 million backing-store pixels. These limits bound work; they are not measured frame-rate claims. Dense contours and multiple active instances need testing on the intended device.
There are no required media files, runtime dependencies, remote fonts or service requests. The asset notice records procedural authorship.
The preview runs the component’s own JavaScript. It respects reduced motion and pauses when off screen. The HTML bundle includes a poster fallback.
Every setting in this panel comes from the component manifest. Preview size, pause and replay stay in the inspector.