Retro grid
A grid floor running away into the distance.
Add it to your project
With the Magic UI commandTerminal
npx shadcn@latest add @magicui/retro-grid
First time with Magic UI? Set it up once.
The code
"use client"
import { useEffect, useRef, useState } from "react"
import type { CSSProperties, HTMLAttributes } from "react"
import { cn } from "@/lib/utils"
const ANIMATION_DURATION_SECONDS = 15
const GRID_HEIGHT_RATIO = 3
const GRID_LINE_ALIGNMENT_OFFSET_PX = 0.5
const GRID_LINE_ANTIALIAS_MULTIPLIER = 0.9
const GRID_LINE_WIDTH_PX = 0.92This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.
Changed for this site: Heading gradient from the Figma palette instead of neon.