Components

Tech Grid

An animated tech grid background for React and Tailwind CSS: a quiet blueprint grid with a faint scan line sweeping past, or a retro perspective floor that scrolls slowly toward the viewer. Built with Motion and pure CSS, no canvas.

  • Background
  • Blueprint grid
  • Perspective
  • Pauses off-screen
  • Reduced-motion safe

Infrastructure as code

Describe your stack in one file and preview every change.

Installation

$ npx shadcn@latest add https://duskui.com/r/tech-grid.json

The grid fills its nearest positioned parent. It is pointer-events-none, so it never blocks the content on top.

Usage

hero.tsx
import { TechGrid } from "@/components/dusk/techy/tech-grid"

export function Hero() {
  return (
    <section className="relative overflow-hidden">
      <TechGrid />
      <div className="relative">{/* your content */}</div>
    </section>
  )
}

Examples

Perspective floor

variant="perspective" tilts the grid into a receding floor that scrolls toward you, with a faint scan line moving down it. The horizon scales with the container.

Version 2.0 is here

Faster builds and a new CLI.

Customizing

Change color, cellSize and speed, or switch off the scanLine.

cellSize=24 · no scan line
perspective · speed=1.5

API Reference

Any other div prop is passed to the root.

PropTypeDefaultDescription
variant"flat" | "perspective""flat"Blueprint grid or receding floor.
colorstring"rgb(255 255 255)"Line and scan color, mixed down to a faint tint. Any CSS color.
cellSizenumber40Size of one grid cell in px.
speednumber1Speed multiplier for the floor and the scan line.
scanLinebooleantrueSweep a faint scan line across the grid.
fadebooleantrueFade the flat grid out toward the edges.
classNamestring—Merged onto the absolutely positioned root.

Accessibility

  • Decorative only: the root is aria-hidden and pointer-events-none, so nothing is blocked.
  • With prefers-reduced-motion the floor stops and the scan line is removed.
  • Animations pause while the grid is off-screen or the tab is hidden, and stop on unmount.