# Eddy — Cursor Effect for React

> A WebGL fluid-simulation cursor trail: pointer strokes inject ink into a curl-noise-advected flow field (ping-pong framebuffers) that swirls, marbles, and slowly dissipates, paling as it disperses. Deep ultramarine on a transparent canvas, scoped to its container, coarse-pointer- and reduced-motion-safe; clicks stack heavier blots and it idles on its own when untouched.

- Page: https://crucibleui.com/components/cursors/eddy
- Category: [cursors](https://crucibleui.com/components/cursors)
- Tier: pro (one-time purchase, see https://crucibleui.com/pricing)
- Engine: ogl
- npm dependencies: ogl

## Install

```bash
npx shadcn@latest add @crucible/eddy
```

Pro install requires adding the token-bearing `@crucible` registry to components.json (issued at https://crucibleui.com/account after purchase).

Import from `@/components/crucible/eddy`.

## Props (`EddyProps`)

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `color?` | `string` | `deep ultramarine` | Ink color (hex). The dye blooms saturated at the core and desaturates toward a pale wash as it disperses. |
| `intensity?` | `number` | — | Dye opacity multiplier, 0–1-ish. 1 = default. |
| `dissipation?` | `number` | `0.55` | Fraction of dye kept after one second, 0–1. Lower fades faster. |
| `radius?` | `number` | `0.11` | Splat radius as a fraction of the container's height. |
| `swirl?` | `number` | — | How strongly the ink curls on itself. 1 = default. |
| `global?` | `boolean` | — | Attach to the whole viewport instead of the nearest containing element. Off by default — Eddy is scoped to its parent (place it inside a `relative` container) so ink never flows page-wide unless you opt in. |
| `paused?` | `boolean` | — | Freeze the simulation, holding the current frame. |
| `className?` | `string` | — | Extra classes for the wrapper. Positioned `absolute inset-0`. |
| `idle?` | `boolean` | `true` | Idle autoplay (scoped mode only): after 1.5s with no pointer in the container, a ghost hand stirs the water along a slow seeded Lissajous path and now and then drops a blot, so the surface never looks dead — on touch-only devices too. A real pointer takes over instantly. Never under reduced motion; sleeps offscreen. |
| `ref?` | `React.Ref<EddyHandle>` | — | React 19 ref prop — imperative `pulse(x?, y?)` blot. |

## Usage example

```tsx
import { Eddy } from "@/components/crucible/eddy";

export default function EddyDemo() {
  return (
    <div className="relative isolate flex h-full min-h-[360px] w-full items-center justify-center overflow-hidden rounded-xl bg-neutral-950">
      <div
        aria-hidden
        className="pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_center,rgba(255,255,255,0.04),transparent_70%)]"
      />
      {/* Scoped to this stage — ink only flows inside the panel. */}
      <Eddy />
      <div className="relative z-10 px-6 text-center">
        <p className="text-3xl font-semibold tracking-tight text-white">Move your cursor</p>
        <p className="mx-auto mt-2 max-w-sm text-sm text-neutral-500">
          Stir the water with slow strokes — click to drop a heavier blot of ink.
        </p>
      </div>
    </div>
  );
}
```

## Accessibility & performance

Honors `prefers-reduced-motion` with a designed static frame or fade (never a blank box) and passes `className` through. Pauses offscreen and on hidden tabs, clamps device pixel ratio, and tears down its GL/canvas context on unmount.
