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/wavesUsage
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
| Prop | Type | Default | Description |
|---|---|---|---|
color | string | "#0ea5e9" | Water colour, any CSS colour or var() |
accentColor | string | "#f97316" | Sun, halo and glitter colour |
speed | number | 0.6 | Animation speed multiplier. 0 freezes the sea |
waveHeight | number | 1.6 | Multiplies the wave height |
horizon | number | 0.45 | Where the horizon sits, 0 (top) to 1 (bottom) |
sun | boolean | true | Shows the sun, its halo and the glitter path |
foam | number | 1.5 | Multiplies the white caps on the crests |
cellSize | number | 3 | Size of one dither cell in CSS px |
strength | number | 1 | Ink opacity multiplier (capped at full opacity) |
fps | number | 40 | Frame 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
<Waves
accentColor="#facc15"
waveHeight={0.7}
horizon={0.4}
foam={0.4}
speed={0.5}
className="absolute inset-0 h-full w-full"
/>