Ripple
MotionReact 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.
Installation
npx shadcn@latest add @minidev/ripple
MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/ripple.json
Usage
import { Ripple } from "@/components/ui/ripple"
export function Example() {
return (
<Ripple />
)
}
API reference
| Prop | Type | Default |
|---|---|---|
| countNumber of rings. | number | 7 |
| spacingGap between neighbouring rings in pixels. | number | 44 |
| sizeDiameter of the innermost ring in pixels. | number | 128 |
| originCentre of the rings, in percent of the panel width and height. | { x: number; y: number } | { x: 50, y: 50 } |
| durationSeconds for one pulse to travel out and settle. | number | 4 |
| interactiveSend a ripple out from the pointer on click or tap. | boolean | true |
| className | string | - |
| children | React.ReactNode | - |
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.
Accessibility
- The rings are
aria-hiddenandpointer-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.
Frequently asked questions
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.
Dependencies
npm
Built from
Examples
Tighter rings
More rings with less spacing and a shorter duration read as a quick, busy pulse; click anywhere to add a burst.
Off centre
origin places the rings in percent of the panel, so the content can sit to one side.
Not interactive
interactive={false} turns off the click burst; a slow duration suits a calm presence or status panel.