{
  "registryVersion": 1,
  "id": "backgrounds/dot-grid-spotlight",
  "slug": "dot-grid-spotlight",
  "category": "backgrounds",
  "title": "Dot Grid Spotlight",
  "description": "A canvas dot grid where dots near the pointer grow, glow in an accent color, and lean toward it like a magnetic field, under a soft spotlight. Works in light and dark mode.",
  "tags": [
    "background",
    "cursor",
    "magnetic",
    "ambient",
    "glow"
  ],
  "useCases": [
    "Hero background for a developer tool or SaaS product",
    "Interactive backdrop behind a sign-up or contact section",
    "Subtle texture for a portfolio or agency landing page"
  ],
  "placement": [
    "background",
    "hero"
  ],
  "style": [
    "techy",
    "minimal"
  ],
  "intensity": "subtle",
  "stack": {
    "framework": "react",
    "styling": "tailwindcss"
  },
  "dependencies": {
    "npm": {
      "gsap": "^3.13.0",
      "@gsap/react": "^2.1.0"
    },
    "gsapPlugins": []
  },
  "variants": [],
  "version": "1.0.1",
  "updatedAt": "2026-10-05",
  "design": {
    "motion": "smooth",
    "pace": "moderate",
    "radius": "round",
    "scheme": "both",
    "palette": "accent",
    "hues": [
      "red"
    ],
    "triggers": [
      "hover",
      "loop"
    ]
  },
  "adapt": {
    "colors": [
      {
        "hue": "red",
        "classes": 0,
        "literals": 1
      }
    ],
    "radiusClasses": [
      "rounded-3xl",
      "rounded-full"
    ],
    "eases": [
      "none",
      "power2",
      "power3"
    ],
    "durations": [
      0.3,
      10
    ]
  },
  "photoSlots": [],
  "sprinkles": [],
  "page": "/snippets/backgrounds/dot-grid-spotlight",
  "preview": "/preview/backgrounds/dot-grid-spotlight",
  "registryPath": "/registry/snippets/backgrounds/dot-grid-spotlight.json",
  "install": "npm i gsap @gsap/react",
  "codeLines": 234,
  "readme": "# Dot Grid Spotlight\r\n\r\n`backgrounds/dot-grid-spotlight`\r\n\r\nA canvas dot grid where dots near the pointer grow, glow in an accent color, and lean toward it like a magnetic field, under a soft spotlight. Works in light and dark mode.\r\n\r\n## When to use\r\n\r\n- Hero background for a developer tool or SaaS product.\r\n- Interactive backdrop behind a sign-up or contact section.\r\n- Subtle texture for a portfolio or agency landing page.\r\n\r\n## Install\r\n\r\n1. `npm i gsap @gsap/react`\r\n2. Copy the code with the **Copy** button on the snippet page and save it as a React component.\r\n3. Use it:\r\n\r\n```tsx\r\n<DotGridSpotlight gap={18} accent=\"#22c55e\" radius={180} className=\"h-[560px] max-w-none rounded-none\">\r\n  <YourHero />\r\n</DotGridSpotlight>\r\n```\r\n\r\n## Props\r\n\r\n| Prop | Type | Default | Description |\r\n| --- | --- | --- | --- |\r\n| `gap` | `number` | `22` | Distance between dots in px. |\r\n| `dotColor` | `string` | panel text color | Any CSS color. By default the dots use the panel's `text-neutral-300 dark:text-neutral-700`, so they follow light/dark mode. |\r\n| `accent` | `string` | `\"#ff5a36\"` | Color of lit dots and the spotlight. |\r\n| `radius` | `number` | `150` | Reach of the pointer's pull in px. |\r\n| `dotSize` | `number` | `1.4` | Base dot radius in px (lit dots grow to about 3.6×). |\r\n| `autoPlay` | `boolean` | `false` | A virtual pointer traces a Lissajous loop while the real pointer is away (it hands over instantly and returns 1.2 s after the pointer leaves). |\r\n| `children` | `ReactNode` | sample hero | Content shown on top. |\r\n| `className` | `string` | `\"\"` | Extra classes for the panel (it is `h-[420px] max-w-5xl rounded-3xl` by default). |\r\n\r\n## Photos\r\n\r\nNo photos and no sprinkles: the grid is drawn on a `<canvas>`.\r\n\r\n## Customization\r\n\r\n- Everything is drawn on `gsap.ticker`, so it pauses with GSAP and costs one canvas pass per frame (all base dots in a single path).\r\n- Magnet strength: `0.3` in `x += dx * f * 0.3`. Growth: `2.6` in `r += f * dotSize * 2.6`.\r\n- Pointer smoothing: the two `gsap.quickTo` calls (`duration: 0.55`).\r\n- Edge fade: the radial `mask-image` on the canvas.\r\n- Users with `prefers-reduced-motion` see a still dot grid.\r\n",
  "sourceDir": "snippets/backgrounds/dot-grid-spotlight",
  "thumbnail": "/registry/thumbnails/backgrounds/dot-grid-spotlight.webp",
  "thumbnailDark": "/registry/thumbnails/backgrounds/dot-grid-spotlight.dark.webp",
  "codeAccess": "The code is not in this file. Get it with the MCP tool get_snippet and an InWebAsset API key (header Authorization: Bearer aw_...; sign in at /agents to create one), or with the Copy button on the snippet page after signing in. Free accounts can take snippet code 5 times per day (every fetch counts, also of a snippet fetched before); Pro accounts have no limit."
}
