# Ripple Button

> A ring and a wave from the exact point of contact.

Every press sends a ripple out from where it landed; fast presses stack. Keyboard presses ripple from the centre.

- Family: Buttons
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/ripple-button/
- Licence: https://galactrex.com/ui/license/

## Install

```sh
npx @galactrex/ui login   # once, with an API key from https://galactrex.com/account/
npx @galactrex/ui add ripple-button
```

It installs to `components/galactrex/ripple-button.tsx`, with the shared motion helpers beside it. First time in a project: `npx @galactrex/ui init` (setup guide: https://galactrex.com/docs/ui-components-setup/).

## Usage

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

<RippleButton tone="outline" onClick={save}>Save</RippleButton>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | Label. |
| `tone` | `"solid" \| "outline" \| "ghost"` | `"solid"` | Look. |
| `duration` | `number` | `0.65` | Seconds per ripple. |
| `...button props` | `ButtonHTMLAttributes` | — | onClick, disabled, type and the rest. |

## Variants

- **Any tone.** Solid, outline or ghost.

## Accessibility

- The click runs at once; ripples are decorative.

## Motion

- Scale and opacity per ripple; at most five live.
- Reduced motion: a brief tint.
