A decorative dotted canvas overlay for design surfaces and page backgrounds.
Content sits above the dots.
Installation
npx shadcn@latest add https://reactdocs.canceydejean.dev/r/dot-canvas.jsonUsage
Place DotCanvas inside a relative container. It fills the parent with a dotted grid and ignores
pointer events, so content above stays interactive.
import { DotCanvas } from "@/lib/dot-canvas";
export function Example() {
return (
<div className="relative h-48 overflow-hidden rounded-xl border">
<DotCanvas />
<p className="relative z-10 p-6 text-sm">Content sits above the dots.</p>
</div>
);
}Pass size as 12, 20, or 24 (default) to change grid pitch. Use className for opacity,
masks, or placement overrides.