Modus UI

Dew Pane

Web (React)

Fine beads of dew that grow, merge and run down a pane, drawn in theme ink.

A 2D canvas simulates beads that grow in place, then run down, swallowing smaller beads in their path and leaving a primary ripple at the bottom edge. Beads use the theme's muted ink with a paper glint; every colour can be overridden. 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 / Dew Pane

Installation

CLI

npx @modus-ui/cli add dew-pane

Manual

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

Usage

tsx
import { DewPane } from "@/components/ui/dew-pane";

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

Props

PropTypeDefaultDescription
speednumber0.8Simulation speed multiplier.
dropAmountnumber1.5Multiplier on the maximum number of beads.
opacitynumber1Overall opacity of the beads.
dropColorstringundefinedHex override for the bead body. Defaults to the theme muted foreground.
edgeColorstringundefinedHex override for the bead rim. Defaults to the theme foreground.
highlightColorstringundefinedHex override for the glint. Defaults to the theme background.
splashColorstringundefinedHex override for the ripple. Defaults to the theme primary.
backgroundColorstringundefinedCSS background. Defaults to the theme background.

Comments

  • No comments yet.