WebberUI

Topographic Lines Background

A decorative background of SVG topographic contour lines slowly drifting and morphing.

The closed SVG contour lines of several hills slowly morph and drift, each on its own phase, forming a low-contrast topographic map layer. Content is layered above the background through children, which suits hero sections and pages with an outdoor or exploration mood.

Loading preview…
npx shadcn@latest add https://webberui.com/r/topographic-lines-background.json

Playground

Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.

6
1
1
0.5
<TopographicLinesBackground />

Installation

npx shadcn@latest add https://webberui.com/r/topographic-lines-background.json

Or, once registries are configured in components.json, install it as @webberui/topographic-lines-background.

Usage

import { TopographicLinesBackground } from "@/components/ui/topographic-lines-background";

<TopographicLinesBackground className="rounded-2xl border">
  <section className="px-8 py-20 text-center">
    <h2 className="text-3xl font-semibold">Walk among the contours</h2>
    <p className="mt-3 text-neutral-500">Read the shape of every mountain with your own two feet.</p>
  </section>
</TopographicLinesBackground>

Props

PropTypeDefaultDescription
lineColorstring"currentColor"Contour line color, adjustable separately for light and dark mode via a text-* class on the wrapper
densitynumber6Number of contour rings per hill (2–12) — higher means denser lines
speednumber1Speed multiplier for the drift and morph — higher is faster
strokeWidthnumber1Line thickness (in SVG coordinate units)
lineOpacitynumber0.5Upper bound on the innermost ring's opacity, decreasing step by step outward
childrenReact.ReactNodeForeground content layered above the background
classNamestringMerged into the outermost container's className

Accessibility

  • The background SVG is decorative only, marked aria-hidden and pointer-events-none, so it is never announced by assistive technology and never intercepts foreground interaction
  • When the user has "reduce motion" enabled at the system level, the morph and drift animations stop and the contours become static
  • The contours are low-contrast and low-opacity and sit beneath the content layer (-z-10), so they do not affect the legibility of foreground text
  • The shapes come from a deterministic pseudo-random function seeded by index, so SSR and client rendering agree and no hydration jitter occurs

On this page