{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "shimmer-button",
  "title": "Shimmer button",
  "description": "A light sweep runs across the button. Pure CSS; the sweep is removed for reduced motion.",
  "dependencies": [],
  "registryDependencies": [
    "https://goodui.dev/r/goodui-motion.json"
  ],
  "files": [
    {
      "path": "registry/components/buttons/shimmer-button.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { GooduiTokens } from \"@/lib/goodui-motion\"\n\n// React 19 hoists and dedupes <style href precedence>, so the keyframes ship with the component.\nconst CSS = `\n@keyframes pc-shimmer-sweep { from { transform: translateX(-120%) skewX(-20deg) } to { transform: translateX(220%) skewX(-20deg) } }\n.pc-shimmer::after {\n  content: \"\"; position: absolute; inset: 0; width: 45%;\n  background: linear-gradient(90deg, transparent, var(--pc-shimmer-color, rgb(255 255 255 / 0.45)), transparent);\n  animation: pc-shimmer-sweep var(--pc-shimmer-duration, 2.4s) ease-in-out infinite;\n  pointer-events: none;\n}\n@media (prefers-reduced-motion: reduce) { .pc-shimmer::after { animation: none; opacity: 0 } }\n`\n\nexport type ShimmerButtonProps = React.ComponentProps<\"button\"> & {\n  /** Seconds per sweep. */\n  duration?: number\n  /** Color of the light band. */\n  shimmerColor?: string\n}\n\nexport function ShimmerButton({ className, duration = 2.4, shimmerColor, style, children, ...props }: ShimmerButtonProps) {\n  return (\n    <>\n      <GooduiTokens />\n      <style href=\"pc-shimmer-button\" precedence=\"default\">\n        {CSS}\n      </style>\n      <button\n        data-slot=\"button\"\n        className={cn(\n          \"pc-press pc-shimmer relative inline-flex h-10 items-center justify-center gap-2 overflow-hidden rounded-lg bg-primary px-5 text-sm font-medium text-primary-foreground shadow-[var(--pc-e1)] transition-[transform,box-shadow] outline-none hover:shadow-[var(--pc-e2)] focus-visible:ring-3 focus-visible:ring-ring/50 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4\",\n          className,\n        )}\n        style={{ ...style, [\"--pc-shimmer-duration\" as string]: `${duration}s`, ...(shimmerColor ? { [\"--pc-shimmer-color\" as string]: shimmerColor } : {}) }}\n        {...props}\n      >\n        {children}\n      </button>\n    </>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/goodui/shimmer-button.tsx"
    }
  ],
  "categories": [
    "components",
    "buttons"
  ],
  "type": "registry:component"
}