Modus UI

Ripple Pool

Web (React)

A swirling gradient that ripples like water under the cursor.

A slow swirling gradient with fluid ripples that trail the cursor. It fills its positioned parent and freezes its animation when the user prefers reduced motion. Built on the shaders library (MIT) and rendered with WebGPU.

Move to ripple

Installation

CLI

npx @modus-ui/cli add ripple-pool

Manual

  1. Install shaders with npm install shaders.
  2. Copy the code from the component tab.
  3. Create a file at components/ui/ripple-pool.tsx.
  4. Paste the code.

Usage

tsx
import { RipplePool } from "@/components/ui/ripple-pool";

export default function Example() {
  return (
    <div className="relative h-[500px] w-full overflow-hidden">
      <RipplePool />
      <div className="relative z-10 p-8">
        <h1>Content over the effect</h1>
      </div>
    </div>
  );
}

Props

PropTypeDefaultDescription
colorAstring"#04121f"First swirl colour.
colorBstring"#38bdf8"Second swirl colour.
speednumber0.5Swirl speed.
detailnumber1Swirl detail.
intensitynumber10Ripple strength.
radiusnumber0.5Ripple radius.
decaynumber10How quickly ripples settle.
chromaticSplitnumber1Colour split in the ripples.

Comments

  • No comments yet.