UniqueUI

Dot Grid Background

Interactive dot-grid pattern with a glowing cursor-following effect.

npx uniqueui add dot-grid-background

Preview

Interactive Dots

Move your cursor around

Usage

import { DotGridBackground } from "@/components/ui/dot-grid-background";

export default function Example() {
  return (
    <div className="p-10 w-full text-white">
      <DotGridBackground className="rounded-xl h-[300px] flex items-center justify-center w-full">
        <div className="text-center z-10 w-full relative">
          <h3 className="text-2xl font-bold mb-2">Interactive Dots</h3>
          <p className="text-neutral-400">Move your cursor around</p>
        </div>
      </DotGridBackground>
    </div>
  );
}

Props

PropTypeDescription
childrenReact.ReactNodeComponents mapped into the z-index layer visually above the matrix.
classNamestringContainer abstraction classes.
dotColorstringColor code controlling the default un-illuminated grid representation.
dotSizenumberDiameter specifying visual footprint density of single grid intersections.
gapnumberVector translation pixel count separating independent grid items.
hoverRadiusnumberSpread area around the cursor triggering focus interactions.
hoverScalenumberFloat magnitude expanding intersections actively caught inside the hover bounds.