Modus UI

Thread Swell

Web (React)

A curtain of Three.js threads that swell in rolling waves, inked in the active theme colours.

Forty-six Three.js threads hang like a curtain seen from below, swelling in two layered waves and fading from the primary colour to the muted ink colour. On a dark theme the threads glow additively; on paper they are drawn as ink, and both follow the active palette. It fills its positioned parent, pauses when off screen and renders a still frame when the user prefers reduced motion.

Modus / Thread Swell

Installation

CLI

npx @modus-ui/cli add thread-swell

Manual

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

Usage

tsx
import { ThreadSwell } from "@/components/ui/thread-swell";

export default function Example() {
  return (
    <div className="relative h-[500px] w-full overflow-hidden">
      <ThreadSwell />
      <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).
startColorstring--primaryColour of the first thread (theme token by default).
endColorstring--muted-foregroundColour of the last thread (theme token by default).
backgroundColorstring--backgroundColour behind the threads (theme token by default).

Comments

  • No comments yet.