AI CSS Animations

Gradient Ring Spinner

A conic gradient masked into a ring, so the arc fades from transparent to full color like a comet tail. Modern, single element, no extra markup.

HTML

<div class="ldr-conic-ring" role="status" aria-label="Loading"></div>

CSS

.ldr-conic-ring {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  --t: calc(var(--s) / 9);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 20%, var(--c) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--t)), #000 calc(100% - var(--t) + 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--t)), #000 calc(100% - var(--t) + 1px));
  animation: ldr-conic-ring-spin 1s linear infinite;
}
@keyframes ldr-conic-ring-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ldr-conic-ring, .ldr-conic-ring *, .ldr-conic-ring::before, .ldr-conic-ring::after {
    animation-duration: 3s;
  }
}

Customizing this loader

  • Color: set --ldr-color on the element or a parent. Currently previewing #3b82f6.
  • Size: set --ldr-size. Every dimension in the snippet is derived from it. Currently previewing 64px.
  • Speed: change the duration on the animation shorthand. Delays on the children are relative, so they keep their rhythm.
  • Accessibility: the root carries role="status" and an aria-label so screen readers announce the wait. The reduced-motion rule at the end slows the animation for users who asked for less motion.

Similar loaders