Components
Ripple Button
A button that ripples from where you press it.
<RippleButton>
Save changes
</RippleButton>Installation
npx shadcn@latest add https://ui.zjkm.tech/r/ripple-button.jsonimport { 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
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | The label. | |
rippleColor | string | "rgba(255,255,255,0.45)" | Colour of the ripple. |
...props | button props | Every native <button> prop: onClick, disabled, type and so on. |
With reduced motion, there's no ripple.