# Jelly Button

> A playful button that squashes and stretches like jelly when hovered or focused.

- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: squish, elastic, bounce, playful, hover
- Live preview: https://copy-css.com/snippets/jelly-button
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<button class="btn-jelly">Boing!</button>
```

## CSS

```css
.btn-jelly {
  padding: 14px 34px;
  border: 0;
  border-radius: 16px;
  background: #e11d48;
  color: #fff;
  font: 700 16px/1 system-ui, sans-serif;
  cursor: pointer;
}

.btn-jelly:hover,
.btn-jelly:focus-visible {
  animation: btn-jelly-squish 0.6s ease;
}

.btn-jelly:focus-visible {
  outline: 3px solid #e11d48;
  outline-offset: 4px;
}

@keyframes btn-jelly-squish {
  0%, 100% { transform: scale(1, 1); }
  25% { transform: scale(1.15, 0.85); }
  50% { transform: scale(0.9, 1.1); }
  75% { transform: scale(1.05, 0.95); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-jelly:hover,
  .btn-jelly:focus-visible { animation: none; }
}
```

## Notes

- This CSS Jelly Button is 31 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, keyboard focus styles and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
