Modus UI

Lattice Drift

Web (React)

A WebGL dome of ink points turning slowly under a fading mask, with scattered accent points in the theme primary.

A WebGL dome of ink points turning slowly under a fading mask, with scattered accent points 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 / Lattice Drift

Installation

CLI

npx @modus-ui/cli add lattice-drift

Manual

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

Usage

tsx
import { LatticeDrift } from "@/components/ui/lattice-drift";

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

Props

PropTypeDefaultDescription
speednumber0.7Rotation speed multiplier.
pointSizenumber0.11Size of each point.
opacitynumber0.75Opacity of the points.
maskStartnumber0.05Fraction of the height where the fade mask begins.
maskSolidnumber0.35Fraction of the height where the points are fully visible.
colorstringtheme foregroundColour of most points.
accentColorstringtheme primaryColour of the scattered accent points.
backgroundColorstringtheme backgroundBackground behind the points.

Comments

  • No comments yet.