A woven grid hung from its top edge, swaying in a soft breeze and billowing away from the cursor, with real cloth physics.
A precise, low-contrast grid with a quiet pointer glow and a soft edge vignette, built for clear product heroes and technical portfolio pages.
Customize
Usage
import { ArchitecturalGrid } from "@/components/motionkit/architectural-grid";
<ArchitecturalGrid
className="min-h-[32rem] rounded-3xl"
>
<div className="relative z-10 mx-auto max-w-3xl py-32 text-center">
<p className="text-sm text-white/60">Product update</p>
<h1 className="mt-4 text-6xl font-semibold tracking-tight text-white">Build with clarity.</h1>
</div>
</ArchitecturalGrid>Developer tools, analytics products, architecture studios and technical portfolios that need a precise backdrop without a busy illustration. Place small copy on a dark panel so the grid remains an accent rather than competing with the message.
The grid is made from repeating CSS linear gradients, with a second, wider interval for occasional major lines. A radial gradient adds a soft glow at the pointer using two CSS custom properties updated directly on pointer movement, so the grid never re-renders. The background stays still and uses no canvas or animation loop.
Works in the App Router as is. Requires Tailwind CSS v4.
One command adds the file and installs its dependencies. Needs a components.json (run npx shadcn@latest init once if you don't have one).
npx shadcn@latest add https://www.motionkitui.com/r/architectural-grid.jsonnpm install motionSave as components/motionkit/architectural-grid.tsx.
"use client";
import { useRef, type PointerEvent, type ReactNode } from "react";
type ArchitecturalGridProps = {
children?: ReactNode;
/** Fine-line colour. */
color?: string;
/** Surface beneath the grid. */
background?: string;
/** Distance between grid lines, in pixels. */
size?: number;
/** Cursor glow strength, 0 to 40. */
glow?: number;
/** Let a soft highlight follow the pointer. */
interactive?: boolean;
className?: string;
};
/** A restrained technical grid with a quiet pointer glow, suited to product and portfolio heroes. */
export function ArchitecturalGrid({
children,
color = "#AAB8D0",
background = "#0B1017",
size = 48,
glow = 16,
interactive = true,
className = "",
}: ArchitecturalGridProps) {
const root = useRef<HTMLDivElement>(null);
function move(event: PointerEvent<HTMLDivElement>) {
if (!interactive || event.pointerType === "touch") return;
const rect = event.currentTarget.getBoundingClientRect();
root.current?.style.setProperty("--grid-x", `${event.clientX - rect.left}px`);
root.current?.style.setProperty("--grid-y", `${event.clientY - rect.top}px`);
}
function leave() {
root.current?.style.setProperty("--grid-x", "50%");
root.current?.style.setProperty("--grid-y", "50%");
}
const line = `color-mix(in srgb, ${color} 11%, transparent)`;
const majorLine = `color-mix(in srgb, ${color} 6%, transparent)`;
return (
<div
ref={root}
onPointerMove={move}
onPointerLeave={leave}
className={`relative isolate overflow-hidden bg-[#0B1017] ${className}`}
style={{ backgroundColor: background }}
>
<div
aria-hidden
className="pointer-events-none absolute inset-0 -z-10"
style={{
backgroundImage: `radial-gradient(260px circle at var(--grid-x, 50%) var(--grid-y, 50%), color-mix(in srgb, ${color} ${glow}%, transparent), transparent 100%), linear-gradient(to right, ${line} 1px, transparent 1px), linear-gradient(to bottom, ${line} 1px, transparent 1px), linear-gradient(to right, ${majorLine} 1px, transparent 1px), linear-gradient(to bottom, ${majorLine} 1px, transparent 1px), radial-gradient(ellipse at center, transparent 25%, ${background} 110%)`,
backgroundSize: `auto, ${size}px ${size}px, ${size}px ${size}px, ${size * 5}px ${size * 5}px, ${size * 5}px ${size * 5}px, auto`,
}}
/>
{children}
</div>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Content placed above the grid. |
| color | string | "#AAB8D0" | Grid line and pointer glow colour. |
| background | string | "#0B1017" | Surface colour beneath the grid. |
| size | number | 48 | Distance between fine grid lines, in pixels. |
| glow | number | 16 | Pointer glow strength, from 0 to 40. |
| interactive | boolean | true | Let the highlight follow the pointer. |
| className | string | — | Classes for sizing and rounding the background. |
How we audit: the WCAG 2.2 animation checklist and respecting reduced motion in React.
Yes. The file starts with "use client", so you can import it straight into a Server Component page or layout. It works in Vite as is, and in Astro as a React island.
Nothing beyond React and Tailwind CSS v4. There is no MotionKit package and no Tailwind config to add.
Yes. Run npx shadcn@latest add https://www.motionkitui.com/r/architectural-grid.json in any project with a components.json. It saves the file to components/motionkit and installs its dependencies.
The grid does not animate. Its glow follows the pointer directly and stops when the pointer leaves.
No. It stays still for a calm, readable page. The optional glow follows a mouse or trackpad pointer and is disabled for touch input.
A woven grid hung from its top edge, swaying in a soft breeze and billowing away from the cursor, with real cloth physics.
A quiet dot grid that lights up in teal around the pointer.
A true 3D floor of glowing lines that recedes forever to a lit horizon, with an optional ceiling for a tunnel.
System overview
Designed with precision