Animated Dot Grid
Minimal animated 2D dot grid with slow diagonal drift on light zinc canvas. Clean developer-aesthetic background for documentation sites, Linear-style landing pages, and dashboard shells.
Dependencies
react
npm install react react-domexport function AnimatedDotGridBackground({ children }: { children?: React.ReactNode }) {
return (
<div className="relative min-h-screen overflow-hidden bg-zinc-100">
<div
className="pointer-events-none absolute inset-0 opacity-60"
aria-hidden
style={{
backgroundImage: "radial-gradient(circle, #a1a1aa 1px, transparent 1px)",
backgroundSize: "24px 24px",
animation: "dot-drift 8s linear infinite",
}}
/>
<div className="pointer-events-none absolute inset-0 bg-gradient-to-b from-white/80 via-transparent to-zinc-200/50" aria-hidden />
<style>{`@keyframes dot-drift{0%{background-position:0 0}100%{background-position:24px 24px}}`}</style>
{children && <div className="relative z-10">{children}</div>}
</div>
);
}
Please implement this code in the current project and add it to (Your Desired Section, e.g. homepage hero, pricing page, dashboard). Change the primary accent color to (YOUR HEX CODE COLOR, e.g. #6366F1).
Requirements:
- Use React + Tailwind CSS (match the project's existing setup)
- Install dependencies if needed: npm install react react-dom
- Keep the layout responsive on mobile and desktop
- Replace placeholder copy with content that fits the project
The UI code:
export function AnimatedDotGridBackground({ children }: { children?: React.ReactNode }) {
return (
<div className="relative min-h-screen overflow-hidden bg-zinc-100">
<div
className="pointer-events-none absolute inset-0 opacity-60"
aria-hidden
style={{
backgroundImage: "radial-gradient(circle, #a1a1aa 1px, transparent 1px)",
backgroundSize: "24px 24px",
animation: "dot-drift 8s linear infinite",
}}
/>
<div className="pointer-events-none absolute inset-0 bg-gradient-to-b from-white/80 via-transparent to-zinc-200/50" aria-hidden />
<style>{`@keyframes dot-drift{0%{background-position:0 0}100%{background-position:24px 24px}}`}</style>
{children && <div className="relative z-10">{children}</div>}
</div>
);
}
Replace (Your Desired Section) and (YOUR HEX CODE COLOR) before pasting into Cursor, Copilot, or ChatGPT.