An arc jumps a quarter turn at a time and springs past each stop before settling, like a clock hand on a spring. Four keyframes share one overshooting cubic-bezier, so the bounce needs no extra steps.
Also known as: springy spinner, bouncy spinner, overshoot loading animation.
<svg class="ldr-elastic-arc" viewBox="0 0 48 48" role="status" aria-label="Loading"> <circle class="ldr-elastic-arc-track" cx="24" cy="24" r="19" pathLength="100"></circle> <circle class="ldr-elastic-arc-arc" cx="24" cy="24" r="19" pathLength="100"></circle> </svg>
.ldr-elastic-arc {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
width: var(--s);
height: var(--s);
}
.ldr-elastic-arc circle {
fill: none;
stroke-width: 5;
stroke-linecap: round;
transform-origin: center;
}
.ldr-elastic-arc-track {
stroke: color-mix(in srgb, var(--ldr-color, #3b82f6) 16%, transparent);
}
.ldr-elastic-arc-arc {
stroke: var(--c);
stroke-dasharray: 22 78;
animation: ldr-elastic-arc-step 2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}
@keyframes ldr-elastic-arc-step {
0% { transform: rotate(-101deg); }
25% { transform: rotate(-11deg); }
50% { transform: rotate(79deg); }
75% { transform: rotate(169deg); }
100% { transform: rotate(259deg); }
}
@media (prefers-reduced-motion: reduce) {
.ldr-elastic-arc, .ldr-elastic-arc *, .ldr-elastic-arc::before, .ldr-elastic-arc::after, .ldr-elastic-arc *::before, .ldr-elastic-arc *::after {
animation-duration: 3s;
}
}--ldr-color on the element or a parent.
Currently previewing #3b82f6.--ldr-size. Every dimension in the snippet is
derived from it. Currently previewing 64px.animation shorthand.
Delays on the children are relative, so they keep their rhythm.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.