TetraKits UI Retro 3D Grid ← Library

Retro 3D Grid

Retro 3D perspective grid background with scrolling emerald lines and horizon glow. Synthwave-style React component for hero sections, gaming sites, and devtool landing pages. Pure CSS animation, no canvas required.

3d grid backgroundretro grid reactsynthwave cssperspective grid animationhero background
Live preview

Dependencies

react
npm install react react-dom
export function Retro3DGridBackground({ children }: { children?: React.ReactNode }) {
  return (
    <div className="relative min-h-screen overflow-hidden bg-zinc-950">
      <div
        className="pointer-events-none absolute inset-0 origin-bottom"
        aria-hidden
        style={{
          backgroundImage:
            "linear-gradient(rgba(16,185,129,0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(16,185,129,0.35) 1px, transparent 1px)",
          backgroundSize: "48px 48px",
          transform: "perspective(500px) rotateX(60deg) scale(2)",
          transformOrigin: "center 80%",
          animation: "grid-scroll 3s linear infinite",
        }}
      />
      <div className="pointer-events-none absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-t from-emerald-500/20 to-transparent" aria-hidden />
      <style>{`@keyframes grid-scroll{0%{transform:perspective(500px) rotateX(60deg) scale(2) translateY(0)}100%{transform:perspective(500px) rotateX(60deg) scale(2) translateY(48px)}}`}</style>
      {children && <div className="relative z-10">{children}</div>}
    </div>
  );
}