Modus UI

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.

Modus / Forecast Curve

Installation

CLI

npx @modus-ui/cli add forecast-curve

Manual

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

Usage

tsx
import { ForecastCurve } from "@/components/ui/forecast-curve";

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

Props

PropTypeDefaultDescription
speednumber1Wave speed multiplier.
spacingnumber7Grid spacing between dots in pixels.
dotSizenumber5Maximum dot size in pixels.
archHeightnumber0.5How far the curve rises toward the sides, as a fraction of the height.
thicknessnumber1Thickness multiplier of the curve band.
brightnessnumber1Dot opacity multiplier.
huenumber0Hue rotation in degrees.
saturationnumber1Saturation multiplier.
backgroundColorstringtheme --backgroundScene background.

Comments

  • No comments yet.