Ripple buttonPro
A button that ripples from wherever it's pressed.
$
pnpm dlx shadcn@latest add @lode/ripple-buttonLive preview
When to use
- Primary actions where tactile feedback adds delight.
When not to use
- Dense toolbars: use the regular button.
Installation
$
pnpm dlx shadcn@latest add @lode/ripple-buttonPro components need an API key and the registry in components.json. See CLI and API keys.
1Install the dependencies
npm install motion2Copy the source into your project
Usage
Import it from @/components/ui/ripple-button after installing.
example.tsx
import { RippleButton } from "@/components/ui/ripple-button";
<RippleButton onClick={start}>Get started</RippleButton>API reference
RippleButton
A native button with a ripple from the press point. Accepts button attributes.
variant= "primary"
"primary" | "secondary" | "outline"
Style.
rippleColor
string
Defaults to the text color.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "primary" | "secondary" | "outline" | "primary" | Style. |
| rippleColor | string | – | Defaults to the text color. |
Keyboard interactions
| Keys | Action |
|---|---|
| EnterorSpace | Press (ripples from the center) |
Accessibility
- A real button; ripples are hidden from assistive tech and skipped under reduced motion.
Motion
- Ripples expand to cover the button and fade (650ms); the button presses in slightly.
Responsive behavior
- Hugs its label.
Performance
- Each ripple removes itself when done.
Notes for AI
- Combine with type="submit" in forms; it defaults to type="button".
This page as Markdown, for assistants and coding agents:
/components/ripple-button/markdownThe full library index for assistants is at /llms.txt.
Related
Lode·229 doc pages·llms.txt