Bouncing Dots Overlay

A light three-dot loading overlay with staggered motion.

Add to your project

Pick the way you like to build.

Let your AI assistant add it

Copy this prompt and paste it into the AI tool building your site.

# Integrate this UI component

Add this component to my project.

1. Install any missing dependencies.
2. Make sure Tailwind CSS is set up and scans the new file.
3. Prefer passing props over editing the component source — changing the component itself may break it.
4. Adjust colors, size, and layout via props or wrapper classes to match my project. You know my codebase better than this snippet does.

## Component source

```tsx
"use client";

import { useEffect } from "react";

type BouncingDotsOverlayProps = {
  open: boolean;
  onOpenChange?: (open: boolean) => void;
  label?: string;
  className?: string;
};

export default function BouncingDotsOverlay({
  open,
  onOpenChange,
  label = "Loading",
  className = "",
}: BouncingDotsOverlayProps) {
  useEffect(() => {
    if (!open) return;

    const overflow = document.body.style.overflow;
    const closeOnEscape = (event: KeyboardEvent) => {
      if (event.key === "Escape") onOpenChange?.(false);
    };

    document.body.style.overflow = "hidden";
    window.addEventListener("keydown", closeOnEscape);

    return () => {
      document.body.style.overflow = overflow;
      window.removeEventListener("keydown", closeOnEscape);
    };
  }, [onOpenChange, open]);

  if (!open) return null;

  return (
    <div
      role="status"
      aria-live="polite"
      className={[
        "fixed inset-0 z-50 grid place-items-center bg-slate-950/50 backdrop-blur-sm",
        className,
      ]
        .filter(Boolean)
        .join(" ")}
    >
      <div className="flex items-center gap-3" aria-hidden>
        <span className="h-3 w-3 animate-bounce rounded-full bg-white" />
        <span
          className="h-3 w-3 animate-bounce rounded-full bg-white"
          style={{ animationDelay: "150ms" }}
        />
        <span
          className="h-3 w-3 animate-bounce rounded-full bg-white"
          style={{ animationDelay: "300ms" }}
        />
      </div>
      <span className="sr-only">{label}</span>
    </div>
  );
}

```

Works with your AI tools

ClaudeClaude*
CodexCodex*
LovableLovable
Base44Base44
Figma MakeFigma Make
ReplitReplit*
CursorCursor*
v0v0

* Compatible with most projects that use the default React/Next.js framework.

Built With

ReactTailwind CSS

Props

PropTypeDescription
open*booleanWhether the full-page overlay is visible.
onOpenChange(open: boolean) => voidCalled when Escape closes the overlay.
labelstringScreen-reader loading message.
classNamestringOverride the overlay position, size, or colors.

More Overlay Loaders Components

Spinner Overlay preview

A centered spinner overlay for blocking a page or panel while content loads.

Wave Bars Overlay preview

Five staggered bars that create a compact equalizer-style loading overlay.

Skeleton Overlay preview

A card-shaped skeleton overlay for loading dashboards, forms, and content panels.