A dot travels along a row of faint stops by stretching into a pill toward the next one and snapping its tail after it. One clip-path inset animates, so the ends stay perfectly round.
Also known as: stretching dot loader, dot elastic, rubber band dot.
<div class="ldr-elastic-dot" role="status" aria-label="Loading"> <span></span><span></span><span></span><span></span> <b class="ldr-elastic-dot-blob"></b> </div>
.ldr-elastic-dot {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
--r: calc(var(--s) / 2);
position: relative;
display: flex;
justify-content: space-between;
width: calc(var(--s) * 1.5);
height: calc(var(--s) * 0.24);
}
.ldr-elastic-dot span {
width: 16%;
border-radius: 50%;
background: color-mix(in srgb, var(--ldr-color, #3b82f6) 22%, transparent);
}
.ldr-elastic-dot-blob {
position: absolute;
inset: 0;
background: var(--c);
clip-path: inset(0 84% 0 0 round var(--r));
animation: ldr-elastic-dot-hop 2.4s cubic-bezier(0.6, 0, 0.25, 1) infinite;
}
@keyframes ldr-elastic-dot-hop {
0%, 100% { clip-path: inset(0 84% 0 0 round var(--r)); }
6.67% { clip-path: inset(0 56% 0 0 round var(--r)); }
13.33%, 16.67% { clip-path: inset(0 56% 0 28% round var(--r)); }
23.33% { clip-path: inset(0 28% 0 28% round var(--r)); }
30%, 33.33% { clip-path: inset(0 28% 0 56% round var(--r)); }
40% { clip-path: inset(0 0 0 56% round var(--r)); }
46.67%, 50% { clip-path: inset(0 0 0 84% round var(--r)); }
56.67% { clip-path: inset(0 0 0 56% round var(--r)); }
63.33%, 66.67% { clip-path: inset(0 28% 0 56% round var(--r)); }
73.33% { clip-path: inset(0 28% 0 28% round var(--r)); }
80%, 83.33% { clip-path: inset(0 56% 0 28% round var(--r)); }
90% { clip-path: inset(0 56% 0 0 round var(--r)); }
96.67% { clip-path: inset(0 84% 0 0 round var(--r)); }
}
@media (prefers-reduced-motion: reduce) {
.ldr-elastic-dot, .ldr-elastic-dot *, .ldr-elastic-dot::before, .ldr-elastic-dot::after, .ldr-elastic-dot *::before, .ldr-elastic-dot *::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.