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.
Installation
CLI
npx @modus-ui/cli add dew-paneManual
- Copy the code from the component tab.
- Create a file at
components/ui/dew-pane.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
speed | number | 0.8 | Simulation speed multiplier. |
dropAmount | number | 1.5 | Multiplier on the maximum number of beads. |
opacity | number | 1 | Overall opacity of the beads. |
dropColor | string | undefined | Hex override for the bead body. Defaults to the theme muted foreground. |
edgeColor | string | undefined | Hex override for the bead rim. Defaults to the theme foreground. |
highlightColor | string | undefined | Hex override for the glint. Defaults to the theme background. |
splashColor | string | undefined | Hex override for the ripple. Defaults to the theme primary. |
backgroundColor | string | undefined | CSS background. Defaults to the theme background. |
Comments