carolina

Grid Pulse

Backgrounds 343

About

A hairline grid that lights up in a spectrum wherever the pointer passes, then fades a moment later.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Grid Pulse to your project and fits it to your theme.

Code

How Grid Pulse is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { useState } from "react";

import { GridPulse } from "@/components/ui/grid-pulse";

/** A halo in the page colour, so lit cells never crowd the letters. */
const guard =
  "[text-shadow:0_0_6px_var(--color-background),0_0_14px_var(--color-background),0_0_30px_var(--color-background),0_0_52px_var(--color-background)]";

export default function GridPulseDemo() {
  const [text, setText] = useState(true);
  return (
    <section className="relative flex min-h-[560px] w-full items-center overflow-hidden bg-background">
      <GridPulse />
      <button
        id="grid-pulse-text"
        type="button"
        role="switch"
        aria-checked={text}
        onClick={() => setText(!text)}
        className="absolute right-4 top-4 z-20 inline-flex items-center gap-2 rounded-full border border-border bg-background/80 py-1.5 pl-1.5 pr-3 text-sm text-foreground backdrop-blur"
      >
        <span
          aria-hidden
          className={`relative h-5 w-9 rounded-full transition-colors ${text ? "bg-foreground" : "bg-foreground/20"}`}
        >
          <span
            className={`absolute top-0.5 size-4 rounded-full bg-background transition-[left] ${text ? "left-[18px]" : "left-0.5"}`}
          />
        </span>
        Text
      </button>
      {text ? (
        <div className="relative z-10 mx-auto w-full max-w-5xl px-6">
          <h1
            className={`text-[clamp(56px,11vw,144px)] font-semibold leading-[0.9] tracking-[-0.045em] text-foreground ${guard}`}
          >
            grid pulse
          </h1>
          <p
            data-grid-avoid
            className={`mt-7 max-w-[42ch] text-[clamp(16px,1.5vw,20px)] leading-normal text-foreground ${guard}`}
          >
            A fine grid that lights up where the pointer passes and lets go a
            moment later. Move across it.
          </p>
        </div>
      ) : null}
    </section>
  );
}

More by carolina

View all
  • Draggable Widget Grid

    Draggable Widget Grid

    2.4K
  • Techstack

    Techstack

    174
  • Reactive Glow Grid

    Reactive Glow Grid

    38

More in Backgrounds

View all
  • Elegant Dark Pattern

    Elegant Dark Pattern

    811
  • Gradient Backgrounds

    Gradient Backgrounds

    25
  • Jade Sky

    Jade Sky

    85
  • Light theme Tailwind CSS Background Snippet

    Light theme Tailwind CSS Background Snippet

    221
  • Gradient Blur Bg

    Gradient Blur Bg

    34
  • Background snippets

    Background snippets

    16
  • Background Components

    Background Components

    233
  • LivingOrigami bg

    LivingOrigami bg

    134