# Ripple Pond

> A procedural 2-D wave canvas. Clicks and hover inject amplitude at the cursor; waves propagate and interfere until they decay.

Source: https://nyxui.com/components/ripple-pond

---
<ComponentPreview name="ripple-pond-demo" />

Ripple Pond is a React canvas component that runs a classic 2-D water simulation — every cell each frame becomes the average of its four neighbours minus its previous value, damped. Clicks splat a strong impulse, and (optionally) hover sprinkles a softer one; waves interfere, reflect off the edges, and decay over time.

Cell size trades fidelity for CPU; the defaults are tuned for a smooth 60 fps on mid-range laptops at typical hero-section sizes.

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx shadcn@latest add "https://nyxui.com/r/ripple-pond.json"
```

</TabsContent>

<TabsContent value="manual">

<Steps>

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="ripple-pond" />

<Step>Update the import paths to match your project setup.</Step>

</Steps>

</TabsContent>

</Tabs>

## Usage

```tsx
import { RipplePond } from "@/components/ui/ripple-pond";

export function Example() {
  return (
    <div className="h-80 w-full overflow-hidden rounded-xl">
      <RipplePond />
    </div>
  );
}
```

### Calmer, clicks only

```tsx
<RipplePond cellSize={8} strength={10} ripplesOnHover={false} />
```

## Props

| Prop             | Type      | Default   | Description                                                      |
| ---------------- | --------- | --------- | ---------------------------------------------------------------- |
| `cellSize`       | `number`  | `4`       | Simulation cell size in pixels. Lower = finer waves + more CPU.  |
| `strength`       | `number`  | `18`      | How strong each click/hover is.                                  |
| `damping`        | `number`  | `0.985`   | Energy retained per frame. `1` means waves never decay.          |
| `ripplesOnHover` | `boolean` | `true`    | Fire a smaller ripple on mousemove in addition to click.         |
| `rain`           | `boolean` | `false`   | Drop ambient droplets at random so the surface moves on its own. |
| `color`          | `string`  | sky blue  | Any valid CSS colour for the lit wave crests.                    |
| `background`     | `string`  | card tone | Any valid CSS colour for the pond background.                    |
| `className`      | `string`  | —         | Extra classes on the canvas element.                             |