Contour Field
Topographic lines that shift slowly behind a section and part around the pointer.
PROGet Contour Field and 168 other Pro components with pro lifetime — Get Pro
- Category
- Creative
- Access
- ProPro · unlocked
- Source
- 284 lines · one file
- States
- 4 drawn
The decision inside it
The lines are computed, not drawn from an image
The field is traced at even levels every frame, so lines never cross or break and stay sharp at any size. It is a background first: capped at 30 frames a second, only on screen, low contrast behind text, and a still map for reduced motion.
When to use it
Use Contour Field as a calm, technical backdrop: live topographic lines that drift and rise under the pointer. Put your heading inside it.
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Liro's Contour Field for this.
Install it: npx shadcn@latest add @liro/contour-field
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/contour-field.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.
Usage
import { ContourField } from "@/components/ui/contour-field";
export function Hero() {
return (
<ContourField className="h-[520px] text-neutral-950 dark:text-white">
<div className="flex h-full items-center justify-center">
<h1 className="text-5xl font-bold tracking-tight">Map the terrain before you build.</h1>
</div>
</ContourField>
);
}API reference
“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Type | Notes | ||
|---|---|---|---|
levels | number | No | Number of contour levels. Default 14. |
scale | number | No | Size of the field's features; larger is broader hills. Default 1. |
speed | number | No | How fast the field drifts. 0 for still. Default 1. |
interactive | boolean | No | Raise the field under the pointer. Default true. |
fade | boolean | No | Fade toward the edges. Default true. |
Dependencies
npm packages
clsxtailwind-mergeLiro foundations, installed alongside it
liro-themeStates
All of them are drawn by the component. None is left for you to design.
- Drifting
- Pointer rise
- Still
- Reduced motion
Accessibility
- Keyboard reachable throughout, in visual order
- Focus trapped in overlays, Escape closes them
- Focus returns to whatever opened it
- Live regions announce what changed, not that something did
- Honours prefers-reduced-motion
Responsive behavior
- Sizes to its container, not the viewport
- Usable from 320px up
- Pointer-based interaction, so trackpad and touch both work
- No hover-only affordances