Backgrounds

Waves

A woven field of flowing waves rendered on a WebGL line shader.

Install

bun add ogl

Then copy 2 files into your project:

  • components/registry/waves/waves.tsx
  • hooks/use-animation-loop.ts

Props

PropTypeDefaultDescription
colorstring (hex)"#a855f7"Line color of the waves.
amplitudenumber1.5Wave displacement strength.
distancenumber0.2Z-spread between the layered lines.
saturationnumber1Color saturation of the field.
opacitynumber0.7Overall opacity of the waves.
enableMouseInteractionbooleantrueLet the cursor bend the field.

What It Demonstrates

Loop
An animation that repeats, a set number of times or infinitely.
Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.
Hardware acceleration
Animating transform and opacity lets the GPU keep motion smooth.

Related Components

Appears In