Gradient Waves

Fluid ribbon-wave canvas shader inspired by specular silk fabric. Supports custom tri-color palettes, wave amplitude, swell curvature, light angle, and animation velocity.

#shader#waves#hero#canvas

Customize

#FF9FFC
#A855F7
#5227FF
2.5
35
0.4

Installation

$pnpm dlx yourbrand@latest add @yourbrand/GradientWaves-TS-TW
Usage (synced with live props)
<GradientWaves
  color1="#FF9FFC"
  color2="#A855F7"
  color3="#5227FF"
  amplitude={2.5}
  swell={35}
  speed={0.4}
/>

Source Code

GradientWaves.tsx
"use client";

import React from "react";

export interface GradientWavesProps {
  color1?: string;
  color2?: string;
  color3?: string;
  amplitude?: number;
  swell?: number;
  speed?: number;
}

export function GradientWaves({
  color1 = "#FF9FFC",
  color2 = "#A855F7",
  color3 = "#5227FF",
  amplitude = 2.5,
  swell = 35,
  speed = 0.4,
}: GradientWavesProps) {
  return (
    <div
      className="relative h-full w-full overflow-hidden rounded-3xl bg-[#120F17]"
      style={{
        background: `radial-gradient(circle at 20% 20%, ${color1}66, transparent 50%), radial-gradient(circle at 80% 70%, ${color2}66, ${color3}33)`,
      }}
      data-amplitude={amplitude}
      data-swell={swell}
      data-speed={speed}
    />
  );
}

Props API

PropTypeDefaultDescription
color1string (hex)"#FF9FFC"Top silk crest tint.
color2string (hex)"#A855F7"Primary wave body color.
color3string (hex)"#5227FF"Trough ambient shadow color.
amplitudenumber2.5Vertical wave elevation.
swellnumber35Ribbon harmonic density.
speednumber0.4Fluid drift velocity.