Waves

A WebGL2 shader of a dithered sea at sundown, with ray-marched waves, a glitter path and foam on the crests.

Props
Color
#0ea5e9
Accent
#f97316
Speed0.60
Wave height1.60
Horizon0.45
Foam1.5
Cell size3
Strength1.00

Installation

pnpm dlx shadcn@latest add @breeze/waves

Usage

import { Waves } from "@/components/breeze/waves"

It works well as a footer or the bottom of a section. The sky is transparent, so the page shows through above the horizon.

<footer className="relative h-[420px] overflow-hidden">
  <Waves className="absolute inset-0 h-full w-full" />
</footer>

Props

PropTypeDefaultDescription
colorstring"#0ea5e9"Water colour, any CSS colour or var()
accentColorstring"#f97316"Sun, halo and glitter colour
speednumber0.6Animation speed multiplier. 0 freezes the sea
waveHeightnumber1.6Multiplies the wave height
horizonnumber0.45Where the horizon sits, 0 (top) to 1 (bottom)
sunbooleantrueShows the sun, its halo and the glitter path
foamnumber1.5Multiplies the white caps on the crests
cellSizenumber3Size of one dither cell in CSS px
strengthnumber1Ink opacity multiplier (capped at full opacity)
fpsnumber40Frame rate cap

Every prop updates live without restarting the animation. Pass color="var(--foreground)" and accentColor="var(--primary)" to follow your theme instead; theme colours update when it changes. The animation pauses off-screen and shows a still frame with reduced motion.

Examples

Calm dusk