# Download Button

> A download button with an icon badge, file type and size, and an arrow that bounces on hover.

- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: file, arrow, file size, bounce, cta
- Live preview: https://copy-css.com/snippets/download-button
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<button class="btn-download" type="button">
  <svg viewBox="0 0 24 24" aria-hidden="true">
    <g class="btn-download-arrow"><path d="M12 4v10"/><path d="m8 10 4 4 4-4"/></g>
    <path d="M5 19h14"/>
  </svg>
  <span>Download <small>PDF · 2.4 MB</small></span>
</button>
```

## CSS

```css
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 22px 8px 8px;
  border: 0;
  border-radius: 14px;
  background: #047857;
  color: #fff;
  font: 600 16px/1.2 system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-download svg {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 10px;
  background: #065f46;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  box-sizing: border-box;
}

.btn-download small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #d1fae5;
}

.btn-download:hover {
  background: #065f46;
}

.btn-download:hover .btn-download-arrow {
  animation: btn-download-bounce 0.8s ease-in-out infinite;
}

.btn-download:focus-visible {
  outline: 3px solid #047857;
  outline-offset: 3px;
}

@keyframes btn-download-bounce {
  50% { transform: translateY(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-download:hover .btn-download-arrow { animation: none; }
}
```

## Notes

- This CSS Download Button is 57 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses keyframe animations, transitions, transforms and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
