{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"spotlight-card","type":"registry:ui","title":"Spotlight card","description":"Card with a soft radial spotlight and a glowing border that both follow the cursor.","dependencies":["motion"],"registryDependencies":["utils"],"files":[{"path":"registry/items/spotlight-card/spotlight-card.tsx","type":"registry:ui","target":"components/facade/spotlight-card.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { motion, useMotionTemplate, useMotionValue, useReducedMotion } from \"motion/react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface SpotlightCardProps extends React.HTMLAttributes<HTMLDivElement> {\n  /** Spotlight radius in px. Defaults to 360. */\n  size?: number;\n  /** Border glow radius in px. Defaults to 220. */\n  borderSize?: number;\n  /** Spotlight strength as a percentage of brand color. Defaults to 10. */\n  intensity?: number;\n  className?: string;\n  children?: React.ReactNode;\n}\n\nexport function SpotlightCard({\n  size = 360,\n  borderSize = 220,\n  intensity = 10,\n  className,\n  children,\n  onPointerMove,\n  onPointerEnter,\n  onPointerLeave,\n  ...rest\n}: SpotlightCardProps) {\n  const reduce = useReducedMotion();\n  const x = useMotionValue(-1000);\n  const y = useMotionValue(-1000);\n  const [active, setActive] = React.useState(false);\n\n  const spot = useMotionTemplate`radial-gradient(${size}px circle at ${x}px ${y}px, color-mix(in oklch, var(--brand) ${intensity}%, transparent), transparent 70%)`;\n  const ring = useMotionTemplate`radial-gradient(${borderSize}px circle at ${x}px ${y}px, color-mix(in oklch, var(--brand) 55%, transparent), transparent 65%)`;\n\n  return (\n    <div\n      {...rest}\n      onPointerMove={(e) => {\n        const rect = e.currentTarget.getBoundingClientRect();\n        x.set(e.clientX - rect.left);\n        y.set(e.clientY - rect.top);\n        onPointerMove?.(e);\n      }}\n      onPointerEnter={(e) => {\n        setActive(true);\n        onPointerEnter?.(e);\n      }}\n      onPointerLeave={(e) => {\n        setActive(false);\n        onPointerLeave?.(e);\n      }}\n      className={cn(\n        \"group/spotlight relative isolate overflow-hidden rounded-[28px] bg-muted text-foreground\",\n        className,\n      )}\n    >\n      {!reduce ? (\n        <>\n          {/* Border glow: a masked layer that only paints the 1px border ring. */}\n          <motion.div\n            aria-hidden\n            className=\"pointer-events-none absolute inset-0 z-10 rounded-[inherit] p-px transition-opacity duration-500\"\n            style={{\n              background: ring,\n              opacity: active ? 1 : 0,\n              WebkitMask: \"linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0)\",\n              mask: \"linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0)\",\n            }}\n          />\n          <motion.div\n            aria-hidden\n            className=\"pointer-events-none absolute inset-0 -z-10 transition-opacity duration-500\"\n            style={{ background: spot, opacity: active ? 1 : 0 }}\n          />\n        </>\n      ) : null}\n      {children}\n    </div>\n  );\n}\n\nexport default SpotlightCard;\n"}],"categories":["cards"],"meta":{"tier":"free","demo":"import { ArrowUpRight, Calendar, Shield, Sparkles } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { SpotlightCard } from \"./spotlight-card\";\n\ninterface Feature {\n  icon: LucideIcon;\n  eyebrow: string;\n  title: string;\n  body: string;\n  meta: string;\n}\n\nconst features: Feature[] = [\n  {\n    icon: Calendar,\n    eyebrow: \"Same week\",\n    title: \"Book online in 60 seconds\",\n    body: \"Pick a time that works, including early mornings and Saturdays. Reminders by text.\",\n    meta: \"Open 7 AM to 7 PM\",\n  },\n  {\n    icon: Shield,\n    eyebrow: \"No surprises\",\n    title: \"Upfront pricing, every visit\",\n    body: \"We confirm your insurance and share the exact cost before any treatment starts.\",\n    meta: \"In network with 20 plans\",\n  },\n  {\n    icon: Sparkles,\n    eyebrow: \"Modern care\",\n    title: \"Whitening and Invisalign\",\n    body: \"Digital scans instead of molds, and a custom plan you can preview before you commit.\",\n    meta: \"Free smile consult\",\n  },\n];\n\nexport default function Demo() {\n  return (\n    <section className=\"w-full max-w-4xl\">\n      <div className=\"mb-8 flex flex-wrap items-end justify-between gap-3 px-1\">\n        <div>\n          <p className=\"text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground\">Bright Oak Dental, Austin</p>\n          <h3 className=\"mt-2 text-[28px] font-semibold tracking-[-0.03em] sm:text-[34px]\">Dentistry without the dread</h3>\n        </div>\n        <a\n          href=\"#\"\n          className=\"inline-flex items-center gap-1 rounded-md text-[15px] font-medium text-brand underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n        >\n          All services\n          <ArrowUpRight className=\"size-4\" aria-hidden />\n        </a>\n      </div>\n      <div className=\"grid gap-4 md:grid-cols-3\">\n        {features.map((f) => (\n          <SpotlightCard key={f.title} className=\"p-7\">\n            <div className=\"flex items-center justify-between\">\n              <span className=\"inline-flex size-10 items-center justify-center rounded-xl bg-background text-foreground dark:bg-foreground/[0.08]\">\n                <f.icon className=\"size-[18px]\" aria-hidden />\n              </span>\n              <span className=\"text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground\">{f.eyebrow}</span>\n            </div>\n            <h4 className=\"mt-7 text-[19px] font-semibold tracking-[-0.02em]\">{f.title}</h4>\n            <p className=\"mt-2 text-[15px] leading-relaxed text-muted-foreground\">{f.body}</p>\n            <p className=\"mt-7 text-[13px] text-muted-foreground\">{f.meta}</p>\n          </SpotlightCard>\n        ))}\n      </div>\n    </section>\n  );\n}\n"}}