Skip to main content

React animation example

React Wave Animation: Layered Animated Background

Waves make a calm, branded background for a hero or footer. This one layers four waves with different lengths and speeds so the pattern never visibly repeats, and the cursor acts like a stone in water: the waves rise near it and settle after it leaves.

  • 4.1 KB file
  • 6 live inputs
  • React runtime
Live, try it

How this layered wave background works

  • Each layer is a sum of two sine waves; layers differ in wavelength, speed, height and opacity.
  • Near the pointer, amplitude is boosted by a Gaussian falloff, which reads as a swell instead of a spike.
  • Wave height and speed are inputs, so the same file works behind a quiet footer or a loud hero.

Add it to your React app

Install exodeui, download the file below, and paste this. The code updates as you customize. Other runtimes are in the other tabs.

import { ExodeUICanvas } from 'exodeui';

// react-wave-background.bexode goes in /public (download it below)
export function ReactWaveBackground() {
  return (
    <ExodeUICanvas
      src="/react-wave-background.bexode"
      fit="Layout"
      autoPlay
      interactive
      style={{ width: '100%', height: 480 }}
    />
  );
}

Inputs

InputTypeDefaultRange
heightNumber10.2 – 2.5
speedNumber10.1 – 3
headlineTextMake some waves—
accentText#06b6d4hex colour
accent2Text#6366f1hex colour
bgText#040814hex colour

More React animations

The same idea in other frameworks: Flutter liquid wave header · SwiftUI mesh gradient background