Modus UI

Ribbon Light

Web (React)

Diagonal ribbons of ink-toned light drifting over the page, tinted from your theme.

A full-bleed Three.js simplex-noise shader of soft diagonal ribbons that drift and fold across the frame. The two ribbon inks come from the theme's primary hue and are mixed onto the theme background, so it reads as ink on paper in light mode and as light in dark mode. It fills its positioned parent, pauses when off screen and renders a still frame when the user prefers reduced motion.

Modus / Ribbon Light

Installation

CLI

npx @modus-ui/cli add ribbon-light

Manual

  1. Install three.
  2. Copy the code from the component tab.
  3. Create a file at components/ui/ribbon-light.tsx.
  4. Paste the code.

Usage

tsx
import { RibbonLight } from "@/components/ui/ribbon-light";

export default function Example() {
  return (
    <div className="relative h-[500px] w-full overflow-hidden">
      <RibbonLight />
      <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).
primaryColorstringtheme primaryFirst colour of the ribbons.
secondaryColorstringtheme primary, shiftedSecond colour of the ribbons.
backgroundColorstring"hsl(var(--background))"Colour behind the ribbons.

Comments

  • No comments yet.