Modus UI

Contour Sheet

Web (React)

A WebGL contour map drawn like a survey sheet: ink contours on paper, with every fifth index line in the theme primary.

A WebGL contour map drawn like a survey sheet: ink contours on paper, with every fifth index line in the theme primary. It fills its positioned parent, follows the active theme and palette in light and dark mode, pauses when off screen and renders a still frame when the user prefers reduced motion.

Modus / Contour Sheet

Installation

CLI

npx @modus-ui/cli add contour-sheet

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/contour-sheet.tsx.
  3. Paste the code.

Usage

tsx
import { ContourSheet } from "@/components/ui/contour-sheet";

export default function Example() {
  return (
    <div className="relative h-[500px] w-full overflow-hidden">
      <ContourSheet />
      <div className="relative z-10 p-8">
        <h1>Content over the background</h1>
      </div>
    </div>
  );
}

Props

PropTypeDefaultDescription
speednumber0.7Animation speed multiplier (0–3).
lengthnumber0.8Length / reach multiplier (0.35–2.5).
densitynumber1.4Contour band count multiplier (0.25–2.5).
opacitynumber1Opacity of the effect layer (0.05–1).
huenumber0Hue rotation in degrees applied to the final frame.
saturationnumber1Saturation multiplier applied to the final frame.
brightnessnumber1Brightness multiplier applied to the final frame.
backgroundColorstringtheme backgroundPaper colour.
lineColorstringtheme foregroundContour ink.
accentColorstringtheme primaryColour of every fifth (index) contour.

Comments

  • No comments yet.