Polka Dot BG

A clean, gently drifting polka dot pattern. Lightweight and perfect for modern UI.

This is a background component that uses CSS’s radial-gradient to draw a lightweight and clean polka dot pattern. It doesn’t use any images, so it loads quickly and is fully customizable.

Use Cases & Features

Key points of design and UX (Design & UX)

How to customize (Customization Guide)

You can easily adjust the size and spacing of the dots by simply changing CSS variables.

Implementation code (Implementation)

export const PolkaDotBackground: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
return (
  <div className="polka-container relative w-full min-h-[400px] flex items-center justify-center overflow-hidden bg-slate-50 dark:bg-slate-950">
    {/* Polka Dot Pattern */}
    <div className="polka-dots absolute inset-0"></div>
    
    {/* Vignette Overlay */}
    <div className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_center,transparent_0%,rgba(248,250,252,0.85)_100%)] dark:bg-[radial-gradient(circle_at_center,transparent_0%,rgba(2,6,23,0.85)_100%)]"></div>
    
    {/* Content */}
    <div className="relative z-10">
      {children}
    </div>
  </div>
);
};

Browser Support

Fully supported on all modern browsers (Chrome, Firefox, Safari, Edge). Since it is animated using GPU-accelerated transform, it works very smoothly even when scrolling or performing other heavy processing.