Skip to content
VenusUI
Get started

Retro Grid

A perspective grid floor that scrolls toward the viewer and fades at the horizon.

Preview

Installation

npx shadcn@latest add @venusui/retro-grid

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/retro-grid.tsx

Usage

The code behind the preview above.

retro-grid-demo.tsx

import { RetroGrid } from "@/components/ui/retro-grid"

export default function RetroGridDemo() {
  return (
    <div className="relative flex h-72 w-full max-w-2xl items-center justify-center overflow-hidden rounded-xl border bg-background">
      <RetroGrid />
      <p className="relative text-4xl font-semibold tracking-tight">Retro Grid</p>
    </div>
  )
}

API reference

PropTypeDefaultDescription
anglenumber65Tilt of the grid plane, in degrees.
cellSizenumber56Grid cell size, in pixels.

All <div> props, including className and style.

Requirements

  • Tailwind CSS v4. The CLI adds the retro-grid keyframes and --animate-retro-grid to your CSS.

Customization

  • Place it inside a relative overflow-hidden section and put your content after it with relative.
  • A smaller angle flattens the floor; a larger cellSize makes the grid feel closer.

Accessibility

  • Decorative: aria-hidden and ignores the pointer.
  • Stops moving when the user prefers reduced motion.

Troubleshooting

The grid covers the whole page.
Its parent needs position: relative and overflow: hidden.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

Soft, blurred color fields that drift slowly behind content.

Loading preview

Background Beams

Backgrounds

Curved lines across a section with light traveling along them.

Loading preview

Beam Rain

Backgrounds

Beams of light fall to the floor and burst into sparks when they land.