Skip to content
VenusUI
Get started

Ripple Button

A button that sends a ripple out from where it was pressed.

Preview

Installation

npx shadcn@latest add @venusui/ripple-button

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/ripple-button.tsx

Usage

The code behind the preview above.

ripple-button-demo.tsx

import { RippleButton } from "@/components/ui/ripple-button"

export default function RippleButtonDemo() {
  return <RippleButton>Click anywhere on me</RippleButton>
}

API reference

PropTypeDefaultDescription
rippleColorstringtext color at 30%Ripple color. Any CSS color.
type"button" | "submit" | "reset""button"Defaults to button so it never submits a form by accident.

All <button> props, including onClick, disabled and ref. Your onPointerDown and onKeyDown still run.

Requirements

  • Tailwind CSS v4. The CLI adds the ripple keyframes and --animate-ripple to your CSS.
  • React 19, with a cn helper at @/lib/utils.

Customization

  • Restyle with className, e.g. bg-secondary text-secondary-foreground for a quieter button; the ripple follows the text color.
  • Change the ripple speed in --animate-ripple.

Accessibility

  • A native <button>. Enter and Space ripple from the center.
  • No ripple when the user prefers reduced motion.

Troubleshooting

The ripple stays on screen.
Ripples remove themselves when their animation ends. Check that the ripple keyframes are in your CSS.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A button with a light that keeps circling its border.

Loading preview

A heart toggle that pops and bursts when liked, with an optional count.

Loading preview

A primary button with a light sweep across its surface.