AI CSS Animations

Bouncing Dots Loader

Three dots bounce up and down in a staggered rhythm. The friendliest loader in the set, and the one most people picture when they say 'loading dots'.

Also known as: three dots loader, jumping dots.

HTML

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

CSS

.ldr-bouncing-dots {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  display: flex;
  align-items: flex-end;
  gap: calc(var(--s) / 6);
  height: calc(var(--s) * 0.75);
}
.ldr-bouncing-dots span {
  width: calc(var(--s) / 4);
  height: calc(var(--s) / 4);
  border-radius: 50%;
  background: var(--c);
  animation: ldr-bouncing-dots-bounce 0.5s ease-in-out infinite alternate;
}
.ldr-bouncing-dots span:nth-child(2) { animation-delay: 0.16s; }
.ldr-bouncing-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes ldr-bouncing-dots-bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(calc(var(--s) / -2)); }
}

@media (prefers-reduced-motion: reduce) {
  .ldr-bouncing-dots, .ldr-bouncing-dots *, .ldr-bouncing-dots::before, .ldr-bouncing-dots::after {
    animation-duration: 3s;
  }
}

Tailwind CSS version

The same loader using only Tailwind's built-in animation utilities. No custom keyframes or config needed.

<div class="flex items-end gap-2 h-9" role="status" aria-label="Loading">
  <span class="h-3 w-3 animate-bounce rounded-full bg-blue-500"></span>
  <span class="h-3 w-3 animate-bounce rounded-full bg-blue-500 [animation-delay:0.15s]"></span>
  <span class="h-3 w-3 animate-bounce rounded-full bg-blue-500 [animation-delay:0.3s]"></span>
</div>

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