# Architectural Grid

> A precise, low-contrast grid with a quiet pointer glow and a soft edge vignette, built for clear product heroes and technical portfolio pages.

Category: Backgrounds · Free · Updated 2026-11-11 · Live demo: https://www.motionkitui.com/components/architectural-grid

## When to use it

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.

## How it works

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.

## Installation

```bash
npx shadcn@latest add https://www.motionkitui.com/r/architectural-grid.json
```

Or copy `components/motionkit/architectural-grid.tsx` below. Requires react and Tailwind CSS v4. Free for personal projects; commercial use needs MotionKit Plus (https://www.motionkitui.com/pricing).

## Props

| 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. |

## Accessibility

- **Keyboard: Not applicable.** A decorative background with no interactive controls.
- **Screen readers: Pass.** The grid is hidden from assistive technology; only your content is read.
- **Reduced motion: Pass.** The grid does not animate. Its glow follows the pointer directly and stops when the pointer leaves.
- **Colour contrast: Partial.** The grid stays low contrast, but content contrast depends on your chosen colours. Use a solid or translucent backing behind small text.

## Source

```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>
  );
}
```
