AI CSS Animations

Segmented Loading Wheel

Twelve segments arranged in a ring, advancing one tick at a time with steps() instead of gliding. A mechanical, clockwork feel that suits dashboards and dev tools.

Also known as: stepped spinner, ticking wheel.

HTML

<div class="ldr-segmented-wheel" role="status" aria-label="Loading"></div>

CSS

.ldr-segmented-wheel {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  --t: calc(var(--s) / 5);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: conic-gradient(from 0deg, color-mix(in srgb, var(--ldr-color, #3b82f6) 15%, transparent) 0 60%, var(--c) 100%);
  -webkit-mask:
    repeating-conic-gradient(#000 0 20deg, transparent 20deg 30deg),
    radial-gradient(farthest-side, transparent calc(100% - var(--t)), #000 calc(100% - var(--t) + 1px));
  -webkit-mask-composite: source-in;
  mask:
    repeating-conic-gradient(#000 0 20deg, transparent 20deg 30deg),
    radial-gradient(farthest-side, transparent calc(100% - var(--t)), #000 calc(100% - var(--t) + 1px));
  mask-composite: intersect;
  animation: ldr-segmented-wheel-tick 1.2s steps(12) infinite;
}
@keyframes ldr-segmented-wheel-tick {
  to { transform: rotate(360deg); }
}

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