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.
Installation
CLI
npx @modus-ui/cli add thread-swellManual
- Install
three. - Copy the code from the component tab.
- Create a file at
components/ui/thread-swell.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
hue | number | 0 | Hue rotation in degrees (-180 to 180). |
saturation | number | 1 | Saturation multiplier (0 to 2). |
brightness | number | 1 | Brightness multiplier (0.35 to 1.65). |
startColor | string | --primary | Colour of the first thread (theme token by default). |
endColor | string | --muted-foreground | Colour of the last thread (theme token by default). |
backgroundColor | string | --background | Colour behind the threads (theme token by default). |
Comments