# Animated Checkbox

> A checkbox whose tick draws itself with an SVG stroke animation and a little bounce when checked.

- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: checkbox, animation, svg, stroke, draw, check mark
- Live preview: https://copy-css.com/snippets/animated-checkbox
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<label class="check-draw">
  <input type="checkbox" checked>
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5 10 17 19 7"/></svg>
  Send me product updates
</label>
```

## CSS

```css
.check-draw {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #14532d;
  font: 500 15px system-ui, sans-serif;
  cursor: pointer;
}

.check-draw input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid #86efac;
  border-radius: 7px;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.check-draw input:checked {
  border-color: #16a34a;
  background: #16a34a;
  animation: check-draw-pop 0.3s ease;
}

.check-draw input:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
}

.check-draw svg {
  position: absolute;
  left: 3px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  pointer-events: none;
  transition: stroke-dashoffset 0.3s ease 0.05s;
}

.check-draw input:checked + svg {
  stroke-dashoffset: 0;
}

@keyframes check-draw-pop {
  50% {
    transform: scale(1.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .check-draw input,
  .check-draw svg {
    transition: none;
    animation: none;
  }
}
```

## Notes

- This CSS Animated Checkbox is 68 lines of pure CSS (1.2 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.
