AI CSS Animations

Refresh Spinner

Two curved arrows chasing each other round, the refresh or sync icon set in motion. It turns a half circle at a time with a short ease at each end, which reads as retrying rather than waiting.

Also known as: sync icon animation, reload spinner, rotating arrows loader.

HTML

<svg class="ldr-refresh-spinner" viewBox="0 0 48 48" role="status" aria-label="Refreshing">
  <path d="M10.4 17.7A15 15 0 0 1 36.3 15.4M37.8 9.7L37 16.4L30.4 14.9"></path>
  <path d="M37.6 30.3A15 15 0 0 1 11.7 32.6M10.2 38.3L11 31.6L17.6 33.1"></path>
</svg>

CSS

.ldr-refresh-spinner {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  width: var(--s);
  height: var(--s);
  animation: ldr-refresh-spinner-turn 0.9s cubic-bezier(0.55, 0, 0.35, 1) infinite;
}
.ldr-refresh-spinner path {
  fill: none;
  stroke: var(--c);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes ldr-refresh-spinner-turn {
  to { transform: rotate(180deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ldr-refresh-spinner, .ldr-refresh-spinner *, .ldr-refresh-spinner::before, .ldr-refresh-spinner::after, .ldr-refresh-spinner *::before, .ldr-refresh-spinner *::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