Skip to content
caliper ui docs

Pro

Contour field

A topographic map that slowly breathes: contour lines over drifting terrain, with every fifth line drawn heavier like an index contour. Resting the pointer raises a hill, so the lines gather into rings around it and relax when it leaves.

Pro
pnpm dlx shadcn@latest add @caliper/contour-field

Ridge loop

Distance
14.2 km
Ascent
860 m
Time
5 h 10
Installs components/ui/contour-field.tsxDepends on @radix-ui/react-slot, lucide-reactMotion none in component source

When to use

Use it for

  • Backdrops for outdoor, mapping, logistics and climate products.
  • Hero and empty-state surfaces that want texture without imagery.

Skip it when

  • Real terrain; it is generated and means nothing geographically.
  • Behind long text.

Decisions

Why it is built this way, so you know what to keep when you change your copy.

Behaviour

A hill that lags
The raised hill follows the pointer with a short lag and sinks back over about a second, so it feels like ground, not a cursor.

Styling

Two weights, like a survey map
Minor contours are faint hairlines; index contours are heavier, which gives the map depth without shading.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/contour-field

Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { ContourField } from "@/components/ui/contour-field"

The worked example comes with Pro

The 22-line example behind the preview opens here, ready to copy.

  • 576 Pro parts, blocks and page templates, all with source
  • $199 once, with a year of updates. What you have stays yours
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

ContourField

component

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
intervalnumber0.09Height between contour lines; smaller draws more lines.
scalenumber1Size of the hills: higher is broader country.
resolutionnumber10Sample spacing in px; smaller is smoother and costs more.

Accessibility

It is built on native elements and keeps aria-hidden and aria-pressed in step with state.

No custom key handling; Tab and the native activation keys do the work.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Surfaces examples