TetraKits UI CRT Scanlines ← Library

CRT Scanlines

CRT scanline overlay on emerald grid with vignette. Retro terminal aesthetic for devtools, hacker-themed landing pages, and nostalgic brand sites. Subtle scan animation without hurting readability.

crt scanlinesretro terminal bgscanline overlay reactvintage grid backgrounddevtools aesthetic
Live preview

Dependencies

react
npm install react react-dom
export function CrtScanlinesBackground({ children }: { children?: React.ReactNode }) {
  return (
    <div className="relative min-h-screen overflow-hidden bg-zinc-950">
      <div
        className="pointer-events-none absolute inset-0 opacity-20"
        style={{
          backgroundImage: "linear-gradient(rgba(16,185,129,0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(16,185,129,0.5) 1px, transparent 1px)",
          backgroundSize: "32px 32px",
        }}
        aria-hidden
      />
      <div
        className="pointer-events-none absolute inset-0 opacity-[0.07]"
        style={{
          backgroundImage: "repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.4) 2px, rgba(0,0,0,0.4) 4px)",
          animation: "scan 0.1s linear infinite",
        }}
        aria-hidden
      />
      <div className="pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_center,transparent_0%,#09090b_75%)]" aria-hidden />
      <style>{`@keyframes scan{0%{background-position:0 0}100%{background-position:0 4px}}`}</style>
      {children && <div className="relative z-10">{children}</div>}
    </div>
  );
}