{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"cta-banner","type":"registry:block","title":"CTA Banner","description":"Large rounded call-to-action panel on a faded dot grid with a headline, two buttons and a soft volt spotlight that trails the cursor.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":["@geturui/badge","@geturui/button"],"files":[{"path":"registry/geturui/blocks/cta-banner.tsx","type":"registry:block","target":"components/blocks/cta-banner.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { motion, useMotionTemplate, useMotionValue, useSpring } from \"motion/react\";\nimport { ArrowRight } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button, buttonClasses, type ButtonVariant } from \"@/components/ui/button\";\n\nconst REDUCE = \"(prefers-reduced-motion: reduce)\";\nconst subscribeReduce = (cb: () => void) => {\n  const m = window.matchMedia(REDUCE);\n  m.addEventListener(\"change\", cb);\n  return () => m.removeEventListener(\"change\", cb);\n};\n/** Reduced-motion preference that is false on the server and during hydration, so the first render matches. */\nfunction useReducedMotionSafe() {\n  return React.useSyncExternalStore(subscribeReduce, () => window.matchMedia(REDUCE).matches, () => false);\n}\n\nexport interface CtaAction {\n  label: string;\n  /** Renders an anchor when set, otherwise a button. */\n  href?: string;\n  onClick?: () => void;\n}\n\nexport interface CtaBannerProps {\n  /** Small badge above the headline. Pass null to hide. */\n  eyebrow?: string | null;\n  headline?: string;\n  subcopy?: string;\n  primaryAction?: CtaAction;\n  secondaryAction?: CtaAction | null;\n  /** Radial glow that follows the pointer. Off under reduced motion. */\n  spotlight?: boolean;\n  /** \"center\" or \"left\" aligned copy; left puts the buttons on the right on large screens. */\n  align?: \"center\" | \"left\";\n  className?: string;\n}\n\nfunction Action({ action, variant }: { action: CtaAction; variant: ButtonVariant }) {\n  const primary = variant === \"primary\";\n  if (action.href) {\n    return (\n      <a href={action.href} onClick={action.onClick} className={buttonClasses({ variant, size: \"lg\" })}>\n        <span className=\"inline-flex items-center gap-[inherit]\">\n          {action.label}\n          {primary && <ArrowRight aria-hidden className=\"size-4 transition-transform duration-300 ease-[var(--ease-spring)] group-hover/btn:translate-x-[3px]\" />}\n        </span>\n      </a>\n    );\n  }\n  return (\n    <Button size=\"lg\" variant={variant} trailing={primary ? \"arrow\" : undefined} onClick={action.onClick}>\n      {action.label}\n    </Button>\n  );\n}\n\n/** Large rounded call-to-action panel on a dot grid, with a soft spotlight that trails the cursor. */\nexport function CtaBanner({\n  eyebrow = \"Free to start\",\n  headline = \"Ship your next launch page this afternoon\",\n  subcopy = \"Pick a hero, a pricing table and an FAQ. Paste them in, swap the copy, and you are live.\",\n  primaryAction = { label: \"Get started free\" },\n  secondaryAction = { label: \"Talk to sales\" },\n  spotlight = true,\n  align = \"center\",\n  className,\n}: CtaBannerProps) {\n  const reduce = useReducedMotionSafe();\n  const ref = React.useRef<HTMLDivElement>(null);\n  const mx = useMotionValue(50);\n  const my = useMotionValue(30);\n  const x = useSpring(mx, { stiffness: 180, damping: 26 });\n  const y = useSpring(my, { stiffness: 180, damping: 26 });\n  const glow = useMotionValue(0.55);\n  const glowSpring = useSpring(glow, { stiffness: 200, damping: 30 });\n  const background = useMotionTemplate`radial-gradient(520px circle at ${x}% ${y}%, var(--volt-soft), transparent 70%)`;\n  const live = spotlight && !reduce;\n  const left = align === \"left\";\n\n  function onMove(e: React.PointerEvent) {\n    if (!live) return;\n    const r = ref.current?.getBoundingClientRect();\n    if (!r) return;\n    mx.set(((e.clientX - r.left) / r.width) * 100);\n    my.set(((e.clientY - r.top) / r.height) * 100);\n    glow.set(1);\n  }\n\n  return (\n    <section className={cn(\"@container w-full px-4 py-12 sm:px-6 sm:py-16\", className)}>\n      <div\n        ref={ref}\n        onPointerMove={onMove}\n        onPointerLeave={() => {\n          glow.set(0.55);\n          mx.set(50);\n          my.set(30);\n        }}\n        className=\"relative isolate mx-auto max-w-6xl overflow-hidden rounded-xl border border-border bg-surface\"\n      >\n        <div\n          aria-hidden\n          className=\"dot-grid absolute inset-0 -z-20 [mask-image:radial-gradient(ellipse_at_center,#000_30%,transparent_80%)]\"\n        />\n        {spotlight && (\n          <motion.div aria-hidden className=\"pointer-events-none absolute inset-0 -z-10\" style={{ background, opacity: glowSpring }} />\n        )}\n        <div aria-hidden className=\"pointer-events-none absolute inset-x-0 top-0 -z-10 h-px bg-gradient-to-r from-transparent via-volt-ink/50 to-transparent\" />\n\n        <div\n          className={cn(\n            \"flex flex-col gap-8 px-6 py-14 @xl:px-12 @xl:py-20\",\n            left ? \"items-start @4xl:flex-row @4xl:items-end @4xl:justify-between\" : \"items-center text-center\",\n          )}\n        >\n          <div className={cn(\"grid gap-4\", left ? \"max-w-2xl\" : \"max-w-3xl justify-items-center\")}>\n            {eyebrow && (\n              <Badge tone=\"new\" pulse>\n                {eyebrow}\n              </Badge>\n            )}\n            <motion.h2\n              className=\"text-balance font-display text-[34px] font-semibold leading-[1.08] tracking-[-1px] text-ink @xl:text-5xl @xl:tracking-[-1.6px]\"\n              initial={reduce ? { opacity: 0 } : { opacity: 0, y: 14, filter: \"blur(8px)\" }}\n              whileInView={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n              viewport={{ once: true }}\n              transition={{ duration: 0.6, ease: [0.22, 1, 0.36, 1] }}\n            >\n              {headline}\n            </motion.h2>\n            {subcopy && (\n              <motion.p\n                className=\"text-balance text-base leading-7 text-ink-muted @xl:text-lg\"\n                initial={{ opacity: 0 }}\n                whileInView={{ opacity: 1 }}\n                viewport={{ once: true }}\n                transition={{ duration: 0.5, delay: 0.15 }}\n              >\n                {subcopy}\n              </motion.p>\n            )}\n          </div>\n          <motion.div\n            className=\"flex flex-wrap items-center gap-3\"\n            initial={reduce ? { opacity: 0 } : { opacity: 0, y: 10 }}\n            whileInView={{ opacity: 1, y: 0 }}\n            viewport={{ once: true }}\n            transition={{ type: \"spring\", stiffness: 300, damping: 30, delay: 0.25 }}\n          >\n            <Action action={primaryAction} variant=\"primary\" />\n            {secondaryAction && <Action action={secondaryAction} variant=\"secondary\" />}\n          </motion.div>\n        </div>\n      </div>\n    </section>\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":["blocks","cta","banner","spotlight","dot grid","landing","conversion"],"meta":{"tier":"free","license":"MIT","docs":"https://geturui.com/docs/cta-banner"}}