{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "grid-pattern",
  "title": "Grid Pattern",
  "author": "VenusUI",
  "description": "Grid lines as a background, with optional highlighted cells and an edge fade.",
  "files": [
    {
      "path": "registry/default/ui/grid-pattern.tsx",
      "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface GridPatternProps extends React.ComponentProps<\"svg\"> {\n  /** Cell size, in pixels. */\n  size?: number\n  /** Cells to fill, as `[column, row]` pairs counted from the top-left. */\n  highlight?: [number, number][]\n  /** Dash pattern for the lines, e.g. `\"4 2\"`. Solid by default. */\n  dashed?: string\n  /** Fade the grid out toward the edges. */\n  fade?: boolean\n}\n\n/**\n * Grid lines that fill their positioned parent, with optional highlighted\n * cells. Lines use `currentColor`; highlighted cells use the same color at\n * low opacity. Set the color with a text class, e.g. `text-border`.\n */\nfunction GridPattern({ size = 32, highlight = [], dashed, fade = false, className, style, ...props }: GridPatternProps) {\n  const id = `grid-pattern-${React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`\n  return (\n    <svg\n      aria-hidden=\"true\"\n      data-slot=\"grid-pattern\"\n      className={cn(\"pointer-events-none absolute inset-0 size-full text-foreground/10\", className)}\n      style={\n        fade\n          ? { maskImage: \"radial-gradient(ellipse at top, #000 20%, transparent 70%)\", ...style }\n          : style\n      }\n      {...props}\n    >\n      <defs>\n        <pattern id={id} width={size} height={size} patternUnits=\"userSpaceOnUse\">\n          <path d={`M ${size} 0 L 0 0 0 ${size}`} fill=\"none\" stroke=\"currentColor\" strokeDasharray={dashed} />\n        </pattern>\n      </defs>\n      <rect width=\"100%\" height=\"100%\" fill={`url(#${id})`} />\n      {highlight.map(([column, row]) => (\n        <rect\n          key={`${column}-${row}`}\n          x={column * size + 1}\n          y={row * size + 1}\n          width={size - 1}\n          height={size - 1}\n          fill=\"currentColor\"\n          opacity={0.6}\n        />\n      ))}\n    </svg>\n  )\n}\n\nexport { GridPattern, type GridPatternProps }\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "backgrounds"
  ],
  "type": "registry:ui"
}