Topographic Flow

Smoothly evolving topographic contours and elevation gradients with continuous or broken survey lines.

Controls

Terrain

Preset
Terrain scale (px)
Contour density
Terrain distortion
Terrain seed

Contours

Line style
Line width (px)
Line opacity

Palette

Background color
Contour color
Major contour color

Motion

Animate entrance
Flow speed

Mouse

Mouse effect
Effect
Direction
Strength
Radius (px)
Follow (s)
Fade (s)

Properties

28 properties
PropertyTypeDefaultDescription
preset'terrain' | 'survey' | 'aurora' | 'dune' | 'moss' | 'ocean' | 'ember' | 'relief' | 'midnight' | 'blueprint' | 'neon' | 'sunset' | 'sage' | 'graphite' | 'paper'paperInitial palette and contour configuration. Explicit props override the preset.
scalenumber480Larger values create broader hills and valleys. Independent of contour density.
densitynumber5More elevation levels reveal closely spaced, nested curves.
distortionnumber2.4Terrain irregularity and the strength of its smooth elevation morph.
seednumber42Reproducible terrain composition. Changing the seed creates a new map.
lineStyle'solid' | 'mixed' | 'dashed'solidContinuous, all dashed, or a mixture with every fourth elevation level dashed.
lineWidthnumber1Uniform stroke thickness in CSS pixels for all elevation levels.
opacitynumber1Opacity of the contours over the background.
dashLengthnumber7Length of each visible dash along a connected contour.
dashGapnumber8Empty space between dashes, measured along the curve.
backgroundColorstring#ffffffTerrain background. Omitted Paper colors follow the site or system theme: white in light mode, black in dark mode.
lineColorstring#000000Color of the regular elevation lines. Omitted Paper colors are black in light mode and white in dark mode.
accentColorstring#000000Color of every fourth elevation level; Survey uses these for broken lines. Omitted Paper colors are black in light mode and white in dark mode.
gradientDiffusionnumber0Spread the blend between neighboring elevation colors. Higher values soften color bands while keeping the terrain and contours crisp. Relief uses 0.5; Aurora and Ember use 0.35; Ocean uses 0.
grainnumber0Fine white photographic grain with soft footprints. Cached at device resolution and fixed in screen coordinates; also textures the contour ink. Gradient presets use 0.55.
speednumber1.5Rate of the elevation morph. Zero holds the current relief.
hoverEffectselectringsHow the pointer reshapes the contours: rings raises a hill with new contours (default), spread pushes them aside, swirl twists them, ripple sends waves out and drag carries them along the pointer's motion. Presets choose one.
hovernumber0.6How strongly the pointer reshapes the contours with the chosen effect. Negative values reverse it; zero disables the mouse effect.
hoverRadiusnumber200Radius of the push around the pointer, in CSS pixels.
hoverFollownumber0.16Time for the effect to catch up with the pointer, and to build when it enters. Higher values trail behind it.
hoverFadenumber0.8Time for the contours to return to normal after the pointer leaves. Entering follows the Follow time.
pausedbooleanfalseHold the current relief without resetting its animation clock.
animateEntrancebooleantrueFade in over 800 ms after the first complete image or frame is ready. Set false for an immediate entrance. Respects prefers-reduced-motion.
backgroundImagestringnoneOptional CSS background. Presets include a static fallback; gradientColors creates the animated elevation gradient. Passing none disables the preset gradient.
gradientColorsreadonly [string, string, ...string[]] | readonly [][]Two to eight colors ordered from valley to summit, with smooth blends between elevation levels. Relief uses six colors from blue to red. An empty array disables this gradient.
childrenReactNode—Optional foreground content, layered above the decorative canvas.
refTopographicFlowHandle—reset() returns the animated relief to its initial frame.
className / stylestring / CSSProperties—Customize the background styling. Set its dimensions on the parent container.

Usage

Usage
import { TopographicFlow } from './components/topographic-flow';

export function Example() {
  return (
    <TopographicFlow
      animateEntrance={true}
      scale={480}
      density={5}
      speed={1.5}
      distortion={2.4}
      lineWidth={1}
      opacity={1}
      dashLength={7}
      dashGap={8}
      seed={42}
      gradientDiffusion={0}
      paused={false}
      hover={0.6}
      hoverRadius={200}
      hoverFollow={0.16}
      hoverFade={0.8}
      hoverEffect={"rings"}
      backgroundColor={"#ffffff"}
      backgroundImage={"none"}
      gradientColors={[]}
      grain={0}
      lineColor={"#000000"}
      accentColor={"#000000"}
      lineStyle={"solid"}
    />
  );
}

Aurora and Ember use vibrant elevation colors in nearby hues over compact terrain. Ocean keeps its deep blue palette. Relief uses the full blue-to-red height palette with more contours. Gradient diffusion widens the blend between elevation colors. Colors follow the same evolving terrain height as the lines. Speed 0 freezes the relief. You can layer headings, cards or other content inside the component.

Free for personal and commercial projects. Redistributing components, kits or templates requires permission. Read the license.