TetraKits UI Vertical Line Rain ← Library

Vertical Line Rain

Subtle vertical falling lines with emerald glow on dark zinc. Modern matrix-inspired motion without green code rain cliché. Lightweight React background for tech and AI landing heroes.

line rain backgroundmatrix inspired bgfalling lines csstech background reactanimated vertical lines
Live preview

Dependencies

react
npm install react react-dom
const LINES = Array.from({ length: 20 }, (_, i) => ({
  id: i,
  left: `${(i * 5 + 2) % 98}%`,
  delay: `${(i % 10) * 0.5}s`,
  height: 40 + (i % 5) * 20,
}));

export function VerticalRainBackground({ children }: { children?: React.ReactNode }) {
  return (
    <div className="relative min-h-screen overflow-hidden bg-zinc-950">
      {LINES.map((l) => (
        <span
          key={l.id}
          className="pointer-events-none absolute top-0 w-px bg-gradient-to-b from-transparent via-emerald-400/50 to-transparent"
          style={{
            left: l.left, height: l.height,
            animation: `rain 2.5s linear ${l.delay} infinite`,
          }}
          aria-hidden
        />
      ))}
      <div className="pointer-events-none absolute inset-0 bg-gradient-to-b from-zinc-950/50 via-transparent to-zinc-950" aria-hidden />
      <style>{`@keyframes rain{0%{transform:translateY(-100%);opacity:0}10%{opacity:1}90%{opacity:.5}100%{transform:translateY(100vh);opacity:0}}`}</style>
      {children && <div className="relative z-10">{children}</div>}
    </div>
  );
}