Skip to Content
zjkm-ui
Components

Ripple Button

A button that ripples from where you press it.

Props
<RippleButton>
  Save changes
</RippleButton>

Installation

npx shadcn@latest add https://ui.zjkm.tech/r/ripple-button.json
import { RippleButton } from "@/components/ripple-button"

Using JavaScript? Set tsx: false in components.json and the CLI converts it.

New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.

Usage

A ripple spreads from wherever the button is pressed, sized to reach the far corner. Keyboard presses work as normal.

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

export function SaveButton() {
  return <RippleButton type="submit">Save changes</RippleButton>;
}

Props

PropTypeDefaultDescription
childrenReactNodeThe label.
rippleColorstring"rgba(255,255,255,0.45)"Colour of the ripple.
...propsbutton propsEvery native <button> prop: onClick, disabled, type and so on.

With reduced motion, there's no ripple.

On this page