crucıble

Ripple

A Material-style ink ripple that blooms from the exact point of contact, with a spring press-dip and rebound. Concurrent ripples stack; keyboard activation blooms from center.

motionfree

Installation

CLI

npx shadcn@latest add @crucible/ripple

Manual — install dependencies, then copy the source

npm install motion

Props

PropTypeDefaultDescription
colorstringsoft whiteRipple ink color. Any CSS color; drawn at low opacity so it tints, never covers.
sizeRippleSize"md"Padding / font scale of the button.
intensitynumber0.35Peak opacity of the expanding ink, 0–1. Lower reads more restrained.
durationnumber0.6Seconds an ink drop takes to expand across the face and fade.
radiusnumber10Corner radius in px.
asChildbooleanfalseRender the passed child as the root element instead of a <button>, merging in the ripple layer, press feedback, className, style and refs. The child must forward props to a real interactive element.
Also accepts all props of React.ComponentPropsWithoutRef<"button">they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, and passes className through.