Topographic Terrain

Animated 3D topographic layers with adjustable perspective, material, bevel and lighting.

Controls

Terrain

Preset
Terrain scale (px)
Layer density
Terrain distortion
Terrain seed
Relief depth (px)
Layer bevel

Camera

Camera tilt (°)
Camera rotation (°)
Camera zoom

Material

Surface color
Background color
Surface grain

Lighting

Shadow animation
Shadow color
Lighting blend

Contour ink

Line width (px)
Line opacity
Contour color
Major contour color

Motion

Terrain speed

Properties

31 properties
PropertyTypeDefaultDescription
preset'terraced' | 'slate' | 'terraced-top' | 'slate-top' | 'slate-red' | 'slate-red-top' | 'slate-blue' | 'slate-blue-top' | 'slate-cyan' | 'slate-cyan-top' | 'slate-green' | 'slate-green-top' | 'slate-magenta' | 'slate-magenta-top' | 'slate-yellow' | 'slate-yellow-top' | 'slate-rgb' | 'slate-rgb-top'terracedInitial material, terrain and camera configuration. Explicit props override it.
elevationnumber160Vertical height of the 3D relief. Zero flattens the surface.
cameraTiltnumber38Angle from the top-down view. Increase to reveal the sides of the terraced layers.
cameraRotationnumber-20Rotate the view around the terrain without rotating its material or grain.
cameraZoomnumber1Camera magnification, independent of terrain scale and contour density.
terraceSoftnessnumber0.6Width of the smooth transitions between layers. Values above 1 blend neighboring layer edges into broader, smoother relief.
shadowAnimationselectnoneUse a fixed shadow color or a smooth RGB color cycle. The cycle shares visible playback with terrain motion.
shadowCycleDurationnumber6Seconds for one complete RGB shadow cycle, independent of terrain speed. Pause, reduced motion and Speed 0 hold the color. Replay resets it to red.
shadowColorstring#737373Color of the relief shading, independent of the material. The default follows the theme: #737373 in light mode, #9d9d9d in dark mode. Custom values persist across theme changes.
lightingBlendnumber0Blend from the pure selected material with soft relief around every layer edge (0) to directional lighting (1).
lightDirectionnumber315Direction of the single light over the relief. Ambient illumination keeps unlit surfaces readable.
lightIntensitynumber1Strength of directional lighting. Zero leaves ambient illumination and the subtle local layer shading.
surfaceColorstring#ffffffBase material color of the 3D layers. Terraced follows the theme with pure white or black when omitted. Explicit colors override it.
scalenumber400Larger values create broader hills and valleys. Independent of layer density.
densitynumber6Number of elevation levels forming the terraced layers.
distortionnumber2.4Terrain irregularity and the strength of its smooth elevation morph.
seednumber42Reproducible terrain composition. Changing the seed creates a new map.
lineWidthnumber0.5Thickness of optional continuous contour ink on the layer edges, in CSS pixels.
opacitynumber0Opacity of optional contour ink. Zero leaves the material and lighting visible.
backgroundColorstring#ffffffSolid color behind the 3D terrain and the Canvas fallback.
lineColorstring#000000Color of optional contour ink on the layer edges.
accentColorstring#000000Color of optional contour ink at every fourth elevation level.
gradientDiffusionnumber0Spread the blend between neighboring elevation colors without changing the terrain geometry.
grainnumber0.2Fine white grain, cached at device resolution and fixed in screen coordinates. Textures both the surface and optional contour ink.
speednumber1.5Rate of the elevation morph. Zero holds the current relief.
pausedbooleanfalseHold the current relief without resetting its animation clock.
backgroundImagestringnoneOptional CSS background behind the terrain canvas and Canvas fallback. Use gradientColors to color the terrain by elevation.
gradientColorsreadonly [string, string, ...string[]] | readonly [][]Optional two to eight colors ordered from valley to summit. Colors follow the animated elevation field; an empty array uses the surface color.
childrenReactNode—Optional foreground content, layered above the decorative canvas.
refTopographicTerrainHandle—reset() returns the animated terrain to its initial frame.
className / stylestring / CSSProperties—Customize the background styling. Set its dimensions on the parent container.

Usage

Usage
import { TopographicTerrain } from './components/topographic-terrain';

export function Example() {
  return (
    <TopographicTerrain
      scale={400}
      density={6}
      speed={1.5}
      distortion={2.4}
      lineWidth={0.5}
      opacity={0}
      seed={42}
      gradientDiffusion={0}
      surfaceColor={"#ffffff"}
      shadowColor={"#737373"}
      shadowAnimation={"none"}
      shadowCycleDuration={6}
      elevation={160}
      cameraTilt={38}
      cameraRotation={-20}
      cameraZoom={1}
      terraceSoftness={0.6}
      lightingBlend={0}
      lightDirection={315}
      lightIntensity={1}
      grain={0.2}
      paused={false}
      backgroundColor={"#ffffff"}
      backgroundImage={"none"}
      gradientColors={[]}
      lineColor={"#000000"}
      accentColor={"#000000"}
    />
  );
}