Wave Background

Layered ocean waves on a canvas that swell under the cursor. The signature Ombak component.

no dependenciesMIT · free

Ride the wave.

Move your cursor across the water.

Installation

npx shadcn@latest add https://ombakui.com/r/wave-background.json

Usage

import { WaveBackground } from "@/components/wave-background";

export function Hero() {
  return (
    <WaveBackground className="h-[480px] bg-slate-950" blur={2}>
      <h1>Ride the wave.</h1>
    </WaveBackground>
  );
}

Props

PropTypeDefaultDescription
childrenReactNode–Content rendered on top of the waves.
colorsstring[]–Wave colors from back to front. Any CSS color, including var(--…).
speednumber1Animation speed multiplier.
amplitudenumber0.12Wave height as a fraction of the container height.
baselinenumber0.62Vertical position of the waves' resting line, 0 (top) to 1 (bottom).
interactivebooleantrueWaves swell around the cursor.
blurnumber0Soft blur on the back waves for depth, in px.
classNamestring–