The classic single-element CSS spinner: a faint circular track with one colored arc that rotates. One div, one keyframe, works everywhere.
Also known as: circle spinner, loading circle.
<div class="ldr-ring" role="status" aria-label="Loading"></div>
.ldr-ring {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
width: var(--s);
height: var(--s);
border: calc(var(--s) / 10) solid color-mix(in srgb, var(--ldr-color, #3b82f6) 20%, transparent);
border-top-color: var(--c);
border-radius: 50%;
animation: ldr-ring-spin 0.8s linear infinite;
}
@keyframes ldr-ring-spin {
to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
.ldr-ring, .ldr-ring *, .ldr-ring::before, .ldr-ring::after {
animation-duration: 3s;
}
}The same loader using only Tailwind's built-in animation utilities. No custom keyframes or config needed.
<div class="h-12 w-12 animate-spin rounded-full border-4 border-blue-500/20 border-t-blue-500" role="status" aria-label="Loading"></div>
--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.