AI CSS Animations

Circle Dots Spinner

Eight dots around a circle swell and fade in sequence, giving a rotation without anything actually rotating. Very cheap to render and reads well even at 16px.

Also known as: dots in a circle loader, Google dots spinner.

HTML

<div class="ldr-circle-dots" role="status" aria-label="Loading">
  <span></span><span></span><span></span><span></span>
  <span></span><span></span><span></span><span></span>
</div>

CSS

.ldr-circle-dots {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  position: relative;
  width: var(--s);
  height: var(--s);
}
.ldr-circle-dots span {
  position: absolute;
  top: 0;
  left: calc(50% - var(--s) / 14);
  width: calc(var(--s) / 7);
  height: calc(var(--s) / 7);
  border-radius: 50%;
  background: var(--c);
  transform-origin: 50% calc(var(--s) / 2);
  animation: ldr-circle-dots-pulse 1.2s ease-in-out infinite;
}
.ldr-circle-dots span:nth-child(1) { --r: 0deg;   animation-delay: -1.05s; }
.ldr-circle-dots span:nth-child(2) { --r: 45deg;  animation-delay: -0.9s; }
.ldr-circle-dots span:nth-child(3) { --r: 90deg;  animation-delay: -0.75s; }
.ldr-circle-dots span:nth-child(4) { --r: 135deg; animation-delay: -0.6s; }
.ldr-circle-dots span:nth-child(5) { --r: 180deg; animation-delay: -0.45s; }
.ldr-circle-dots span:nth-child(6) { --r: 225deg; animation-delay: -0.3s; }
.ldr-circle-dots span:nth-child(7) { --r: 270deg; animation-delay: -0.15s; }
.ldr-circle-dots span:nth-child(8) { --r: 315deg; animation-delay: 0s; }
@keyframes ldr-circle-dots-pulse {
  0%, 100% { transform: rotate(var(--r)) scale(0.4); opacity: 0.35; }
  50%      { transform: rotate(var(--r)) scale(1);   opacity: 1; }
}

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