# Ripple Button

> A Material-style ripple that spreads from the center when you click. Pure CSS, no JavaScript.

- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: ripple, material, click, press, feedback
- Live preview: https://copy-css.com/snippets/ripple-button
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<button class="btn-ripple">Click me</button>
```

## CSS

```css
.btn-ripple {
  --c: #7c3aed;
  padding: 14px 32px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font: 600 16px/1 system-ui, sans-serif;
  background: var(--c) radial-gradient(circle, transparent 1%, var(--c) 1%) center / 15000%;
  box-shadow: 0 6px 16px -6px rgba(124, 58, 237, 0.6);
  cursor: pointer;
  transition: background 0.8s;
}

.btn-ripple:hover {
  --c: #6d28d9;
}

/* The ripple: shrink the gradient instantly, then let it grow back */
.btn-ripple:active {
  background-color: #c4b5fd;
  background-size: 100%;
  transition: background 0s;
}

.btn-ripple:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 3px;
}
```

## Notes

- This CSS Ripple Button is 28 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, radial gradients, box shadows and keyboard focus styles.
- Customize with: `--c`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
