# Gradient Spinner

> A smooth spinner with a fading gradient tail, made from one element and a mask.

- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: spinner, conic-gradient, mask, loading, purple
- Live preview: https://copy-css.com/snippets/gradient-spinner
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="spinner-gradient" role="status" aria-label="Loading"></div>
```

## CSS

```css
.spinner-gradient {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, #8b5cf6);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  animation: gradient-spin 0.9s linear infinite;
}

@keyframes gradient-spin {
  to { transform: rotate(1turn); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner-gradient {
    animation-duration: 2s;
  }
}
```

## Notes

- This CSS Gradient Spinner is 19 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, radial gradients and conic gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
