Modus UI

Relief Mesh

Web (React)

A slowly turning mesh globe of pulsing nodes joined by fine links, inked in theme tokens and fading into the page background.

A slowly turning mesh globe of pulsing nodes joined by fine links, inked in theme tokens and fading into the page background. 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 / Relief Mesh

Installation

CLI

npx @modus-ui/cli add relief-mesh

Manual

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

Usage

tsx
import { ReliefMesh } from "@/components/ui/relief-mesh";

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

Props

PropTypeDefaultDescription
huenumber0Hue rotation in degrees (-180 to 180).
saturationnumber1Saturation multiplier (0 to 2).
brightnessnumber1Brightness multiplier (0.35 to 1.65).
nodeColorstringtheme primaryColour of the pulsing nodes.
lineColorstringtheme foregroundColour of the links between nodes.
fogColorstringtheme backgroundColour the far side of the globe fades into.
backgroundColorstringtheme backgroundColour behind the effect.

Comments

  • No comments yet.