# Ripple

> React background of concentric rings that pulse outward from the center or any point, staggered and fading, plus an extra ripple from each click or tap.

- Kind: Motion component (Motion)
- Docs: https://ui.minidev.pro/docs/ripple
- Source (registry JSON with the full file): https://ui.minidev.pro/r/ripple.json
- License: MIT. One file, yours to edit after install.

## When to use

Use it behind a "live", "listening" or "connected" message. Reach for OrbitingCircles to show integrations around a centre, and Meteors or Particles for a looser, less centred backdrop.

## Installation

### shadcn CLI (copies the source into your project)

```bash
npx shadcn@latest add @minidev/ripple
```

Writes `components/ui/ripple.tsx` plus the MiniDev files it is built from (button) and installs its npm dependencies. Older CLI versions: `npx shadcn@latest add https://ui.minidev.pro/r/ripple.json`.

### npm package

```bash
npm i minidev-ui-kit lucide-react motion
```

Add the tokens to your global stylesheet once:

```css
@import "tailwindcss";
@import "minidev-ui-kit/styles.css";
@source "../node_modules/minidev-ui-kit";
```

Next.js also needs `transpilePackages: ["minidev-ui-kit"]` in next.config.

## Import

After the shadcn install:

```tsx
import { Ripple } from "@/components/ui/ripple"
```

From the npm package:

```tsx
import { Ripple } from "minidev-ui-kit/premium/ripple"
```

## Usage

```tsx
import { Ripple } from "@/components/ui/ripple"

export function Example() {
  return (
    <Ripple />
  )
}
```

## Props

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `count` | `number` | `7` | no | Number of rings. |
| `spacing` | `number` | `44` | no | Gap between neighbouring rings in pixels. |
| `size` | `number` | `128` | no | Diameter of the innermost ring in pixels. |
| `origin` | `{ x: number; y: number }` | `{ x: 50, y: 50 }` | no | Centre of the rings, in percent of the panel width and height. |
| `duration` | `number` | `4` | no | Seconds for one pulse to travel out and settle. |
| `interactive` | `boolean` | `true` | no | Send a ripple out from the pointer on click or tap. |
| `className` | `string` | - | no |  |
| `children` | `React.ReactNode` | - | no |  |

## Examples

### Tighter rings

More rings with less spacing and a shorter duration read as a quick, busy pulse; click anywhere to add a burst.

```tsx
<Ripple count={10} spacing={28} size={72} duration={3} className="h-72">
  <div className="flex h-full flex-col items-center justify-center gap-2 px-6 text-center">
    <p className="text-2xl font-medium tracking-[-0.03em] text-fg">Syncing 3 bank accounts</p>
    <p className="text-sm text-fg-muted">Tap anywhere to send a ping.</p>
  </div>
</Ripple>
```

### Off centre

origin places the rings in percent of the panel, so the content can sit to one side.

```tsx
<Ripple origin={{ x: 82, y: 40 }} count={6} spacing={56} size={160} className="h-72">
  <div className="flex h-full max-w-md flex-col justify-center gap-3 px-8">
    <span className="w-fit rounded-full border border-accent-line bg-accent-soft px-2.5 py-0.5 text-xs font-medium text-accent-fg">Webhooks</span>
    <p className="text-3xl font-medium tracking-[-0.035em] text-fg">Every event, delivered</p>
    <p className="text-sm text-fg-muted">Lumen retries failed deliveries for 24 hours and signs every payload.</p>
  </div>
</Ripple>
```

### Not interactive

interactive={false} turns off the click burst; a slow duration suits a calm presence or status panel.

```tsx
<Ripple interactive={false} duration={6} count={5} className="h-64">
  <div className="flex h-full flex-col items-center justify-center gap-3 text-center">
    <Avatar size="lg"><AvatarFallback>MC</AvatarFallback></Avatar>
    <p className="text-sm font-medium text-fg">Maya Chen is sharing her screen</p>
    <Button size="sm" variant="outline">Join the call</Button>
  </div>
</Ripple>
```

## Accessibility

- The rings are `aria-hidden` and `pointer-events-none`, so clicks reach your content.
- Under reduced motion the rings are drawn still and clicks do not add ripples.
- Animations pause when the panel is more than 80px outside the viewport.

## FAQ

### How do I turn off the click ripple?

Pass `interactive={false}`. By default a primary-button press anywhere on the panel, including on your buttons on top, sends an extra ripple out from the pointer. At most six extra ripples exist at once.

### How do I centre the rings on something other than the middle?

Set `origin` in percent of the panel: `origin={{ x: 50, y: 40 }}`. `size` is the innermost ring's diameter and `spacing` the gap between rings, both in pixels.

## Rules for generating code

- Use semantic tokens only (bg, surface, sunken, border, fg, fg-muted, fg-subtle, ink, accent, success, warning, danger). Never raw hex or palette steps like blue-500.
- Shadows only from the set: shadow-xs, shadow-sm, shadow-raised, shadow-md, shadow-lg, shadow-overlay.
- Numbers use tabular-nums. Dark mode is the `dark` class on <html>; components never branch on theme.

## Dependencies

- npm: `lucide-react`, `motion`
- Built from: [button](https://ui.minidev.pro/docs/button/md)

## Related

- [Orbiting Circles](https://ui.minidev.pro/docs/orbiting-circles/md): Icons orbit a central hub on hairline rings for integration sections. Set radius, speed and direction per ring; icons stay upright while they travel.
- [Meteors](https://ui.minidev.pro/docs/meteors/md): React meteors background that sends accent colored streaks with fading tails falling diagonally behind your content, with count, angle and speed props.
- [Particles](https://ui.minidev.pro/docs/particles/md): React canvas background of drifting particles that repel or attract around the pointer, colored from your accent token and sharp on high density screens.
- [Animated Feature Row](https://ui.minidev.pro/docs/animated-feature-row/md): A row of feature cards that slide up with a staggered delay when scrolled into view. Pass title and description pairs; reduced motion keeps them still.
- [Card Tilt](https://ui.minidev.pro/docs/card-tilt/md): A card that tilts in 3D toward the pointer on springs, with an accent glare that follows the cursor. It stays flat when reduced motion is preferred.
- [Cursor Spotlight Panel](https://ui.minidev.pro/docs/cursor-spotlight-panel/md): A panel whose accent radial spotlight follows the cursor, driven by Framer Motion values without re-renders. It shows a still surface for reduced motion.

---

All 557 components: https://ui.minidev.pro/llms.txt (full text: https://ui.minidev.pro/llms-full.txt).
