---
title: "Contour Range Background"
description: "A 3D mountain range of contour lines that burn where the low sun hits."
url: https://gelatinui.com/components/contour-range-background
markdown_url: https://gelatinui.com/components/contour-range-background.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/contour-range-background"
version: "2026-11-24"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Contour Range Background

> A 3D mountain range of contour lines that burn where the low sun hits.

Page: https://gelatinui.com/components/contour-range-background

## When to use it

Best for: An outdoor or maps hero: a 3D range of glowing contour lines, flown over in low sun.

- Use `tilt` and `altitude` for the view, and `travel` (`forward`, `backward`, `left`, `right`) for the way it flies.
- Use `hoverEffect` (`lift`, `trace`, `light`) and `clickEffect` (`pulse`, `peak`, `none`) for what the hand and a press do.
- Use `markers` (`plus` or `dots`) to add survey marks on a grid.
- Use `mask` (`top`, `bottom`, `edges`, or `radial`) to fade an edge into the page, and `maskSoftness` for the width of the fade.

## When not to use it

- For terraces of stacked paper, use [Paper Relief Background](https://gelatinui.com/components/paper-relief-background.md).
- For lit hills with no lines, use [Terrain Flyover Background](https://gelatinui.com/components/terrain-flyover-background.md).

## Notes for agents

- `pointer` and `press` are on by default.
- `animateIn` is on by default: the map starts flat and rises into mountains when it first runs.
- `glitch` above 0 makes short slices of the picture jump sideways, and a press sets one off too.
- In dark mode the light adds up, so the lines that face the sun burn bright.
- Children sit on top of the moving picture. The root is `relative isolate overflow-hidden`: give it a height, or let a flex parent size it.
- `palette` takes CSS colors: the ground, the second ground, then the look colors. The default palette has its own light and dark values.
- It stops off screen and in a hidden tab. `paused` holds the frame, and `speed={0}` shows a still frame.
- With no WebGL2 the box stays empty. Set `fallback` to show a CSS gradient of the palette there, on the server, and before the first frame.

## Anatomy

```text
ContourRangeBackground
```

## API reference

### ContourRangeBackground

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `palette` | `readonly string[]` | PALETTE | Any CSS colors (`var(--token)` too): the ground, the second ground, then the look colors. |
| `speed` | `number` |  | The time scale: 1 (default) is the designed speed, 0 a still frame. |
| `paused` | `boolean` |  | True holds the current frame. Default false. |
| `trigger` | `BackgroundTrigger` |  | When it moves: `loop` (default) or `hover`. It draws its first frame either way. |
| `seed` | `number` |  | Another seed gives another field of the same look. Default 0. |
| `press` | `boolean` |  | True: a press on the box sends a ripple through the field where it lands; a press on a button or a link inside does not. Default false. |
| `pointer` | `boolean` |  | True: the field leans toward a mouse or pen over the box. Default false. |
| `fps` | `number` |  | The most frames a second. Default: the display rate. |
| `resolution` | `number` |  | A last scale on the canvas pixels, after the caps (0.5 draws a quarter of them). Default 1. |
| `mask` | `"bottom" \| "edges" \| "none" \| "radial" \| "top"` |  | Fades an edge into the page: `radial`, `edges`, `top`, or `bottom`. Default `none`. |
| `vignette` | `number` |  | Darkens toward the corners, 0 to 1. Default 0. |
| `fallback` | `boolean` |  | True: a CSS gradient of the palette shows on the server, until the first WebGL frame, and with no WebGL. Default false: the box stays empty and the live picture fades in, because the gradient looks unlike the real effect and the swap reads as a glitch. |
| `landScale` | `number` |  | How many landforms fit the box height. More gives smaller hills. From 0.5 to 8. Default 1.75. |
| `ridges` | `number` |  | How tall and sharp the mountain ridges are against the plains. From 0 to 1.5. Default 1. |
| `bend` | `number` |  | How much the land twists, from straight folds to winding valleys. From 0 to 2.5. Default 0.8. |
| `detail` | `number` |  | The small wobble in every line. From 0 to 1. Default 0.5. |
| `morph` | `number` |  | How fast the land reshapes over time. 0 keeps it still. From 0 to 2. Default 0.2. |
| `contours` | `number` |  | How many contour lines stack up the tallest mountain. From 6 to 70. Default 22. |
| `lineWidth` | `number` |  | The width of a plain contour, in CSS px, near and far. From 0.4 to 4. Default 1. |
| `indexWidth` | `number` |  | The width of a heavy index contour, in CSS px. From 0.5 to 6. Default 1.7. |
| `indexEvery` | `number` |  | Which contours draw heavy: every fifth at 5. A whole number from 2 to 10. Default 5. |
| `elevation` | `number` |  | How tall the mountains rise. 0 lays the map flat. From 0 to 1.5. Default 0.46. |
| `foreground` | `number` |  | How much height the land keeps as it reaches the view. Low values keep the front clear. From 0 to 1. Default 0.2. |
| `tilt` | `number` |  | The view angle in degrees, from low across the land to 90 for straight down. From 10 to 90. Default 32. |
| `altitude` | `number` |  | How high the view flies over the land. From 0.4 to 2. Default 0.98. |
| `glide` | `number` |  | How fast the view flies over the land. From 0 to 1. Default 0.1. |
| `glow` | `number` |  | The soft light around each line. From 0 to 2. Default 0.6. |
| `focusBlur` | `number` |  | How much lines soften away from the focus, which follows the hand. From 0 to 1. Default 0.4. |
| `fog` | `number` |  | How fast the far land fades into the sky. From 0 to 1. Default 0.42. |
| `brightness` | `number` |  | The overall strength of the lines. From 0.1 to 2.5. Default 1. |
| `sunAngle` | `number` |  | Where the low sun stands around the land, in degrees. From 0 to 360. Default 142. |
| `sunGlow` | `number` |  | How much brighter the slopes that face the sun burn. From 0 to 1.5. Default 0.55. |
| `lift` | `number` |  | How high the land rises under the hand, and how bright it lights. From 0 to 1. Default 0.15. |
| `reach` | `number` |  | How wide the hand reaches, in land units. From 0.1 to 1.5. Default 0.42. |
| `trail` | `number` |  | How long the land takes to settle after the hand leaves. From 0 to 1. Default 0.3. |
| `parallax` | `number` |  | How far the view leans toward the hand. From 0 to 1. Default 0.5. |
| `peak` | `number` |  | How tall the peak from a press grows. From 0 to 1. Default 0.42. |
| `glitch` | `number` |  | How often short slices of the picture jump sideways. A press sets one off too. From 0 to 1. Default 0. |
| `travel` | `"backward" \| "forward" \| "left" \| "right"` |  | Which way the view flies over the land. Default `forward`. |
| `hoverEffect` | `"lift" \| "light" \| "trace"` |  | What the hand does: `lift` raises the land, `trace` lights the contour at its height, `light` only lights the land. Default `lift`. |
| `clickEffect` | `"none" \| "peak" \| "pulse"` |  | What a press does: `pulse` rolls a ring of light over the land, `peak` raises a new mountain, `none` does nothing. Default `pulse`. |
| `markers` | `"dots" \| "none" \| "plus"` |  | Survey marks on a grid over the land. A few blink, and those near the hand get a target frame. Default `none`. |
| `majorLines` | `boolean` |  | Draws every index contour heavier and brighter. Default true. |
| `animateIn` | `boolean` |  | The map starts flat and rises into mountains when it first runs. Default true. |
| `maskSoftness` | `number` |  | The share of the box the mask fade takes, from 0.05 to 0.6. Default 0.25. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| ContourRangeBackground | `contour-range-background` |  | `--contour-range-bg`, `--contour-range-bg-2`, `--contour-range-color-1`, `--contour-range-color-2`, `--contour-range-color-3` |  |

## Usage

Put the hero content inside as children: they sit on top of the moving picture. Give the root a height.

The sample also uses `button`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui-pro/contour-range-background @gelatin-ui/button
```

```tsx title="contour-range-hero.tsx"
import { ContourRangeBackground } from "@/components/pro/backgrounds/contour-range-background";
import { Button } from "@/components/ui/button";

export function ContourRangeHero() {
  return (
    <ContourRangeBackground
      tilt={40} markers="plus"
      className="flex h-[560px] flex-col items-center justify-center gap-6 px-6 text-center"
    >
      <p className="text-sm text-muted-foreground">Ridgeline Maps</p>
      <h1 className="max-w-2xl text-5xl font-light tracking-tight">
        Know the mountain before you climb
      </h1>
      <p className="max-w-md text-muted-foreground">
        Contour maps, avalanche alerts, and routes for every season.
      </p>
      <Button size="lg">Plan a climb</Button>
    </ContourRangeBackground>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/contour-range-background
```

It adds 51 registry items: 51 files, 8361 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Paper Relief Background](https://gelatinui.com/components/paper-relief-background.md)
- [Tide Map Background](https://gelatinui.com/components/tide-map-background.md)
- [Terrain Flyover Background](https://gelatinui.com/components/terrain-flyover-background.md)

## Motion

| Part | Motion |
| --- | --- |
| Show | chart · 600ms · ease-panel · the picture fades in after its first drawn frame |
| Loop | progress · the picture moves on its own clock at one speed; `speed` scales it, and 0 shows a still frame |
