Ripple Grid

A dot grid that ripples like water under the cursor, on click, and on its own.

no dependenciesMIT · free

Touch the water.

Move or click anywhere.

Installation

npx shadcn@latest add https://ombakui.com/r/ripple-grid.json

Usage

import { RippleGrid } from "@/components/ripple-grid";

<RippleGrid className="h-[480px]">
  <h1>Touch the water.</h1>
</RippleGrid>

Props

PropTypeDefaultDescription
childrenReactNode–Content rendered on top of the grid.
gapnumber22Distance between dots in px.
dotSizenumber1.4Dot radius in px.
colorstring"currentColor"Dot color. Any CSS color; defaults to the element's text color.
interactivebooleantrueRipples follow the cursor and clicks.
autoRipplebooleantrueDrop a ripple at a random spot every few seconds.
strengthnumber6How far dots get pushed by a ripple, in px.
classNamestring–