{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"spinner","type":"registry:ui","title":"Spinner","description":"Loading indicator as a ring, dots or equaliser bars in five sizes; it announces itself as a status and slows to a pulse for reduced motion.","author":"GetUrUI <hello@geturui.dev>","dependencies":[],"registryDependencies":[],"files":[{"path":"registry/geturui/ui/spinner.tsx","type":"registry:ui","target":"components/ui/spinner.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport type SpinnerSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type SpinnerVariant = \"ring\" | \"dots\" | \"bars\";\n\nconst px: Record<SpinnerSize, number> = { xs: 12, sm: 16, md: 24, lg: 32, xl: 48 };\n\nexport interface SpinnerProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\"> {\n  /** 12 / 16 / 24 / 32 / 48 px. @default \"sm\" */\n  size?: SpinnerSize;\n  /** Ring arc, three bouncing dots or an equaliser. @default \"ring\" */\n  variant?: SpinnerVariant;\n  /** Announced to screen readers. Pass `null` when a parent already announces (e.g. a busy button). @default \"Loading\" */\n  label?: string | null;\n  /** Visible text beside or under the spinner. */\n  text?: React.ReactNode;\n  /** Put `text` under the spinner instead of beside it. */\n  stacked?: boolean;\n}\n\n/** Loading indicator in three shapes; colour follows `currentColor`, motion slows to a pulse when reduced motion is on. */\nexport function Spinner({ size = \"sm\", variant = \"ring\", label = \"Loading\", text, stacked, className, ...props }: SpinnerProps) {\n  const s = px[size];\n  const stroke = s <= 16 ? 2 : s <= 24 ? 2.5 : 3;\n  const r = (s - stroke) / 2;\n  const c = 2 * Math.PI * r;\n  const glyph =\n    variant === \"ring\" ? (\n      <svg width={s} height={s} viewBox={`0 0 ${s} ${s}`} className=\"shrink-0 animate-spin motion-reduce:animate-[pulse_1.6s_ease-in-out_infinite]\" aria-hidden>\n        <circle cx={s / 2} cy={s / 2} r={r} fill=\"none\" stroke=\"currentColor\" strokeOpacity={0.18} strokeWidth={stroke} />\n        <circle\n          cx={s / 2}\n          cy={s / 2}\n          r={r}\n          fill=\"none\"\n          stroke=\"currentColor\"\n          strokeWidth={stroke}\n          strokeLinecap=\"round\"\n          strokeDasharray={`${Math.round(c * 0.28 * 100) / 100} ${Math.round(c * 100) / 100}`}\n        />\n      </svg>\n    ) : variant === \"dots\" ? (\n      <span className=\"inline-flex shrink-0 items-center\" style={{ gap: s / 8, height: s }} aria-hidden>\n        {[0, 1, 2].map((i) => (\n          <span\n            key={i}\n            className=\"rounded-full bg-current animate-[gu-spinner-dot_900ms_ease-in-out_infinite] motion-reduce:animate-[pulse_1.6s_ease-in-out_infinite]\"\n            style={{ width: s / 4, height: s / 4, animationDelay: `${i * 140}ms` }}\n          />\n        ))}\n      </span>\n    ) : (\n      <span className=\"inline-flex shrink-0 items-center\" style={{ gap: s / 10, height: s }} aria-hidden>\n        {[0, 1, 2, 3].map((i) => (\n          <span\n            key={i}\n            className=\"origin-center rounded-full bg-current animate-[gu-spinner-bar_1s_ease-in-out_infinite] motion-reduce:animate-[pulse_1.6s_ease-in-out_infinite]\"\n            style={{ width: Math.max(2, s / 8), height: s, animationDelay: `${i * 120}ms` }}\n          />\n        ))}\n      </span>\n    );\n  return (\n    <span\n      role={label === null ? undefined : \"status\"}\n      aria-label={label === null || text ? undefined : label}\n      className={cn(\"inline-flex items-center text-current\", stacked ? \"flex-col gap-3\" : \"gap-2\", className)}\n      {...props}\n    >\n      <style>{`@keyframes gu-spinner-dot{0%,80%,100%{transform:translateY(0);opacity:.35}40%{transform:translateY(-35%);opacity:1}}@keyframes gu-spinner-bar{0%,100%{transform:scaleY(.35);opacity:.45}50%{transform:scaleY(1);opacity:1}}`}</style>\n      {glyph}\n      {text && <span className=\"text-sm font-medium text-ink-muted\">{text}</span>}\n    </span>\n  );\n}\n"},{"path":"LICENSE-geturui.md","type":"registry:file","target":"LICENSE-geturui.md","content":"MIT License\n\nCopyright (c) 2026 geturui.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"}],"categories":["components","loading","spinner","progress","status","loader"],"meta":{"tier":"free","license":"MIT","docs":"https://geturui.com/docs/spinner"}}