Skip to content

Ripple

Motion

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.

src/registry/premium/ripple.tsx/r/ripple.json

Installation

bash
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

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

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

API reference

Ripple props
PropTypeDefault
countNumber of rings.number7
spacingGap between neighbouring rings in pixels.number44
sizeDiameter of the innermost ring in pixels.number128
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.number4
interactiveSend a ripple out from the pointer on click or tap.booleantrue
classNamestring-
childrenReact.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-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.

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

lucide-reactmotion

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.

All Animated React components