Waves
Layered bands of colour rolling past each other. The defaults are light, for light sections; pass a dark palette for dark ones.
Ride the wave
import { Waves } from "@/components/waves";
export function WavesDemo() {
return (
<Waves className="flex h-[360px] items-end p-8">
<h2 className="text-3xl font-semibold tracking-tight text-white">
Ride the wave
</h2>
</Waves>
);
}
Installation
pnpm dlx shadcn@latest add https://gradients.sh/r/waves.jsonUsage
import { Waves } from "@/components/waves";
<Waves className="h-[480px]">{children}</Waves>;The gradient fills its box, so give it a height. Children render on top.
Props
| Prop | Type | Default |
|---|---|---|
childrenContent layered on top of the gradient. | ReactNode | — |
colorsTwo to six colours: hex, oklch(), names or var(--token). | [string, string, ...string[]] | ["#a9c1df", "#5479b0", "#24467e", "#0f1c38"] |
backgroundBase colour under the gradient. | string | "#05070d" |
speed0 to 2. How fast the gradient moves. 0 holds it still. | number | 0.6 |
loopSeconds4 to 30. The animation repeats exactly every loopSeconds. | number | 16 |
scale0.25 to 4. Noise frequency: higher means smaller shapes. | number | 1 |
warp0 to 1. Domain-warp strength. | number | 0.4 |
grain0 to 1. Film grain. | number | 0.08 |
blur0 to 1. Softness. | number | 0.35 |
seedInteger seed for the noise field. | number | 11 |
ditherOrdered 4×4 Bayer dither. | { enabled?: boolean; cell?: number; levels?: number } | { enabled: false, cell: 3, levels: 8 } |
interaction0 to 1 influence of the pointer and of scroll velocity. | { pointer?: number; scroll?: number } | { pointer: 0.15, scroll: 0.25 } |
maxDprDevice pixel ratio cap for the canvas. | number | 1.5 |
reducedMotion"respect" shows one still frame when the user prefers reduced motion. | "respect" | "ignore" | "respect" |
classNameClasses for the outer element. Size it here; the gradient fills it. | string | — |