Forecast Curve
Web (React)
A rising dotted curve whose dots swell and shimmer in crossing waves, inked in the theme accent.
A 2D canvas samples a curve that dips low in the middle and lifts toward both edges, like a chart line climbing out of a trough. Each dot on a sparse grid grows with its closeness to the curve and shimmers in crossing waves: cores are drawn in --primary, edges in --muted-foreground, on --background. In dark mode the dots blend additively. It follows palette and mode changes live. 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 forecast-curveManual
- Copy the code from the component tab.
- Create a file at
components/ui/forecast-curve.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
speed | number | 1 | Wave speed multiplier. |
spacing | number | 7 | Grid spacing between dots in pixels. |
dotSize | number | 5 | Maximum dot size in pixels. |
archHeight | number | 0.5 | How far the curve rises toward the sides, as a fraction of the height. |
thickness | number | 1 | Thickness multiplier of the curve band. |
brightness | number | 1 | Dot opacity multiplier. |
hue | number | 0 | Hue rotation in degrees. |
saturation | number | 1 | Saturation multiplier. |
backgroundColor | string | theme --background | Scene background. |
Comments