{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "spinner",
  "title": "Spinner",
  "author": "zyx1121 (https://github.com/zyx1121)",
  "description": "A 3 by 3 LED panel whose lit pixel runs the edge, in CSS.",
  "dependencies": [
    "cn"
  ],
  "registryDependencies": [
    "https://ui.zyx.tw/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/zyx/components/ui/spinner.tsx",
      "content": "import { cn } from \"../../lib/utils\"\n\n// A 3 by 3 panel of square pixels: a lit pixel runs the edge clockwise and\n// leaves a fading trail, like an LED. Pure CSS (globals.css, Spinner), so it\n// runs before hydration. It is decoration: put a text label beside it.\nfunction Spinner({ className, ...props }: React.ComponentProps<\"span\">) {\n  return (\n    <span\n      data-slot=\"spinner\"\n      aria-hidden\n      className={cn(\"grid size-4 shrink-0 grid-cols-3 gap-px\", className)}\n      {...props}\n    >\n      {Array.from({ length: 9 }, (_, index) => (\n        <span key={index} className=\"bg-current\" />\n      ))}\n    </span>\n  )\n}\n\nexport { Spinner }\n",
      "type": "registry:ui"
    }
  ],
  "css": {
    "[data-slot=\"spinner\"] > *": {
      "opacity": "0.15"
    },
    "[data-slot=\"spinner\"] > :not(:nth-child(5))": {
      "animation": "pixel-ring 720ms step-end infinite"
    },
    "[data-slot=\"spinner\"] > :nth-child(1)": {
      "animation-delay": "-720ms"
    },
    "[data-slot=\"spinner\"] > :nth-child(2)": {
      "animation-delay": "-630ms"
    },
    "[data-slot=\"spinner\"] > :nth-child(3)": {
      "animation-delay": "-540ms"
    },
    "[data-slot=\"spinner\"] > :nth-child(6)": {
      "animation-delay": "-450ms"
    },
    "[data-slot=\"spinner\"] > :nth-child(9)": {
      "animation-delay": "-360ms"
    },
    "[data-slot=\"spinner\"] > :nth-child(8)": {
      "animation-delay": "-270ms"
    },
    "[data-slot=\"spinner\"] > :nth-child(7)": {
      "animation-delay": "-180ms"
    },
    "[data-slot=\"spinner\"] > :nth-child(4)": {
      "animation-delay": "-90ms"
    },
    "@keyframes pixel-ring": {
      "0%": {
        "opacity": "1"
      },
      "12.5%": {
        "opacity": "0.6"
      },
      "25%": {
        "opacity": "0.3"
      },
      "37.5%, 100%": {
        "opacity": "0.15"
      }
    },
    "@media (prefers-reduced-motion: reduce)": {
      "[data-slot=\"spinner\"] > *": {
        "animation": "none !important"
      },
      "[data-slot=\"spinner\"] > :nth-child(1)": {
        "opacity": "1"
      }
    }
  },
  "meta": {
    "useWhen": "Waiting without a measure, beside a label: saving, signing in.",
    "notFor": "Waiting with a measure; use progress.",
    "related": [
      "progress",
      "button"
    ]
  },
  "docs": "Use when: Waiting without a measure, beside a label: saving, signing in.\nNot for: Waiting with a measure; use progress.\nGuide: https://ui.zyx.tw/spinner.md",
  "categories": [
    "feedback",
    "motion"
  ],
  "type": "registry:ui"
}