AI CSS Animations

Pulse Loader

A solid dot that throbs while a soft halo expands away from it. The 'ping' pattern from status indicators, turned into a loader.

Also known as: ping animation, radar dot.

HTML

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

CSS

.ldr-pulse {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  width: calc(var(--s) / 2);
  height: calc(var(--s) / 2);
  margin: calc(var(--s) / 4);
  border-radius: 50%;
  background: var(--c);
  animation: ldr-pulse-throb 1.4s ease-out infinite;
}
@keyframes ldr-pulse-throb {
  0%   { transform: scale(0.85); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ldr-color, #3b82f6) 55%, transparent); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 calc(var(--s) / 3) transparent; }
  100% { transform: scale(0.85); box-shadow: 0 0 0 0 transparent; }
}

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

Tailwind CSS version

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

<span class="relative flex h-6 w-6" role="status" aria-label="Loading">
  <span class="absolute inline-flex h-full w-full animate-ping rounded-full bg-blue-500 opacity-60"></span>
  <span class="relative inline-flex h-6 w-6 rounded-full bg-blue-500"></span>
</span>

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