Components

Wavy Background

An animated wavy background for React: layered, flowing waves in your own colors, drawn on a canvas from built-in seeded noise and softened with a blur. No dependencies for the noise, deterministic on every mount, and paused when nobody can see it.

  • Background
  • Canvas
  • Built-in noise
  • Custom palette
  • High-DPI
  • Pauses off-screen
  • Reduced-motion safe

Data pipelines

Move data between your warehouse and apps on a schedule.

Installation

$ npx shadcn@latest add https://duskui.com/r/wavy-background.json

The waves fill their nearest positioned parent, so give the parent relative and overflow-hidden, and put your content after it with relative.

Usage

hero.tsx
import { WavyBackground } from "@/components/dusk/wavy-background/wavy-background"

export function Hero() {
  return (
    <section className="relative overflow-hidden">
      <WavyBackground colors={["#34d399", "#22d3ee", "#818cf8"]} />
      <div className="relative">{/* your content */}</div>
    </section>
  )
}

Examples

Palette & blur

One wave is drawn per entry in colors, back to front. A wider waveWidth with a bigger blur melts them into a glow; seed picks a different set of waves.

Warm palette

Crisp lines

blur={0} and a thin waveWidth turn the waves into flowing strands. amplitude sets how far they swing, as a fraction of the height.

waveWidth=2 blur=0

API Reference

Any other div prop is passed to the root. The blur is a CSS filter on the canvas, which overhangs the sides so waves don't fade at the edges.

PropTypeDefaultDescription
colorsstring[]mint, sky, indigoOne wave per color, back to front. Any CSS colors.
waveWidthnumber32Thickness of each wave in px.
blurnumber16Softness in px; 0 keeps the waves crisp.
speednumber0.7Flow speed multiplier; 0 holds the waves still.
waveOpacitynumber0.25Opacity of each wave, 0–1.
amplitudenumber0.2Vertical swing as a fraction of the container height.
seednumber1Seed for a different, but stable, set of waves.
classNamestring—Merged onto the absolutely positioned root.

Accessibility

  • The waves are decorative: the root is aria-hidden and pointer-events-none.
  • With prefers-reduced-motion a single still frame is drawn.
  • Drawing stops while the waves are off-screen or the tab is hidden.
  • Waves run behind the middle of the container; lower waveOpacity or add a text shadow if copy sits on top of bright colors.