{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"hero-section","type":"registry:block","title":"Hero","description":"Marketing hero with a pulsing announcement pill, a word-by-word headline with a volt-marked word, two CTAs, a copyable install command and a floating product shot of animated UI cards.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":["@geturui/badge","@geturui/button","@geturui/copy-button","@geturui/number-ticker","@geturui/text-animation"],"files":[{"path":"registry/geturui/blocks/hero-section.tsx","type":"registry:block","target":"components/blocks/hero-section.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\nimport { ArrowRight, Check, GitBranch, Search, Sparkles } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button, buttonClasses, type ButtonVariant } from \"@/components/ui/button\";\nimport { CopyButton } from \"@/components/ui/copy-button\";\nimport { NumberTicker } from \"@/components/ui/number-ticker\";\nimport { RevealText } from \"@/components/ui/text-animation\";\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 HeroAction {\n  label: string;\n  /** Renders an anchor when set, otherwise a button. */\n  href?: string;\n  onClick?: () => void;\n}\n\nexport interface HeroSectionProps {\n  /** \"centered\" stacks copy over the product shot; \"split\" puts them side by side on large screens. */\n  variant?: \"centered\" | \"split\";\n  /** Text inside the announcement pill. Pass null to hide the pill. */\n  eyebrow?: string | null;\n  /** Short label on the pulsing badge inside the pill. */\n  eyebrowBadge?: string;\n  eyebrowHref?: string;\n  headline?: string;\n  /** One word of the headline to underline with a volt swash. */\n  mark?: string;\n  subcopy?: string;\n  primaryAction?: HeroAction;\n  secondaryAction?: HeroAction;\n  /** Shell command shown with a copy button. Pass null to hide the row. */\n  installCommand?: string | null;\n  /** Show the floating product shot made of animated UI cards. */\n  showProductShot?: boolean;\n  className?: string;\n}\n\nfunction Cta({ action, variant }: { action: HeroAction; variant: ButtonVariant }) {\n  const arrow = 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          {arrow && (\n            <ArrowRight aria-hidden className=\"size-4 transition-transform duration-300 ease-[var(--ease-spring)] group-hover/btn:translate-x-[3px]\" />\n          )}\n        </span>\n      </a>\n    );\n  }\n  return (\n    <Button variant={variant} size=\"lg\" trailing={arrow ? \"arrow\" : undefined} onClick={action.onClick}>\n      {action.label}\n    </Button>\n  );\n}\n\n/** Entrance + idle float for a product-shot card. */\nfunction Floating({\n  children,\n  className,\n  delay = 0,\n  drift = 8,\n  reduce,\n}: {\n  children: React.ReactNode;\n  className?: string;\n  delay?: number;\n  drift?: number;\n  reduce: boolean;\n}) {\n  return (\n    <motion.div\n      className={className}\n      initial={reduce ? { opacity: 0 } : { opacity: 0, y: 24, scale: 0.96, filter: \"blur(6px)\" }}\n      animate={{ opacity: 1, y: 0, scale: 1, filter: \"blur(0px)\" }}\n      transition={{ type: \"spring\", stiffness: 260, damping: 30, delay }}\n    >\n      <motion.div\n        animate={reduce ? undefined : { y: [0, -drift, 0] }}\n        transition={{ duration: 6 + delay * 2, repeat: Infinity, ease: \"easeInOut\", delay: delay + 0.6 }}\n      >\n        {children}\n      </motion.div>\n    </motion.div>\n  );\n}\n\nfunction MiniSwitch({ reduce }: { reduce: boolean }) {\n  return (\n    <span aria-hidden className=\"relative flex h-5 w-9 items-center rounded-full border border-border-strong bg-surface-sunken p-[2px]\">\n      <motion.span\n        className=\"absolute inset-0 rounded-full bg-volt\"\n        animate={reduce ? { opacity: 1 } : { opacity: [0, 0, 1, 1, 0] }}\n        transition={{ duration: 4, repeat: Infinity, times: [0, 0.3, 0.4, 0.8, 0.9] }}\n      />\n      <motion.span\n        className=\"relative block size-[14px] rounded-full bg-ink\"\n        animate={reduce ? { x: 16 } : { x: [0, 0, 16, 16, 0] }}\n        transition={{ duration: 4, repeat: Infinity, times: [0, 0.3, 0.4, 0.8, 0.9], ease: \"easeInOut\" }}\n      />\n    </span>\n  );\n}\n\nfunction ProductShot({ reduce, className }: { reduce: boolean; className?: string }) {\n  return (\n    <div aria-hidden className={cn(\"relative mx-auto w-full max-w-[640px] select-none\", className)}>\n      <div className=\"pointer-events-none absolute -inset-10 -z-10 rounded-full bg-volt-soft opacity-60 blur-3xl\" />\n      <Floating reduce={reduce} drift={4} className=\"relative\">\n        <div className=\"overflow-hidden rounded-lg border border-border bg-surface shadow-lg\">\n          <div className=\"flex items-center gap-2 border-b border-border px-4 py-3\">\n            <span className=\"size-2.5 rounded-full bg-surface-hover ring-1 ring-border\" />\n            <span className=\"size-2.5 rounded-full bg-surface-hover ring-1 ring-border\" />\n            <span className=\"size-2.5 rounded-full bg-surface-hover ring-1 ring-border\" />\n            <span className=\"ml-3 inline-flex h-6 flex-1 items-center gap-1.5 rounded-full bg-surface-sunken px-3 font-mono text-[11px] text-ink-subtle\">\n              <Search className=\"size-3\" /> geturui.com/components\n            </span>\n          </div>\n          <div className=\"grid grid-cols-[120px_1fr] gap-0 @xl:grid-cols-[150px_1fr]\">\n            <div className=\"hidden flex-col gap-2 border-r border-border p-4 @md:flex\">\n              {[64, 80, 52, 72, 60, 44].map((w, i) => (\n                <span key={i} className={cn(\"h-2 rounded-full\", i === 1 ? \"bg-volt\" : \"bg-surface-raised\")} style={{ width: `${w}%` }} />\n              ))}\n            </div>\n            <div className=\"col-span-2 grid gap-3 p-4 @md:col-span-1\">\n              <div className=\"flex items-center justify-between\">\n                <span className=\"h-3 w-28 rounded-full bg-surface-raised\" />\n                <span className=\"inline-flex h-6 items-center rounded-full bg-volt px-3 text-[11px] font-semibold text-on-volt\">Install</span>\n              </div>\n              <div className=\"grid grid-cols-2 gap-3\">\n                <div className=\"grid gap-2 rounded-md border border-border bg-bg p-3\">\n                  <span className=\"text-[11px] font-medium text-ink-muted\">Reduced motion</span>\n                  <MiniSwitch reduce={reduce} />\n                </div>\n                <div className=\"grid gap-2 rounded-md border border-border bg-bg p-3\">\n                  <span className=\"text-[11px] font-medium text-ink-muted\">Build</span>\n                  <span className=\"h-1.5 overflow-hidden rounded-full bg-surface-sunken\">\n                    <motion.span\n                      className=\"block h-full origin-left rounded-full bg-volt\"\n                      animate={reduce ? { scaleX: 0.8 } : { scaleX: [0.1, 1, 1] }}\n                      transition={{ duration: 3.2, repeat: Infinity, times: [0, 0.75, 1], ease: \"easeInOut\" }}\n                    />\n                  </span>\n                </div>\n              </div>\n              <div className=\"grid gap-1.5 rounded-md bg-surface-sunken p-3 font-mono text-[11px] leading-4\">\n                <span>\n                  <span className=\"text-ember-ink\">import</span> <span className=\"text-ink\">{\"{ Button }\"}</span>{\" \"}\n                  <span className=\"text-ember-ink\">from</span> <span className=\"text-volt-ink\">&quot;@/ui/button&quot;</span>\n                </span>\n                <span className=\"text-ink-subtle\">{\"// spring press, nudging arrow\"}</span>\n                <span className=\"text-ink\">\n                  {\"<Button trailing=\\\"arrow\\\">Ship it</Button>\"}\n                  {!reduce && (\n                    <motion.span\n                      className=\"ml-0.5 inline-block h-3 w-[6px] translate-y-0.5 bg-volt\"\n                      animate={{ opacity: [1, 0, 1] }}\n                      transition={{ duration: 1, repeat: Infinity, ease: \"linear\" }}\n                    />\n                  )}\n                </span>\n              </div>\n            </div>\n          </div>\n        </div>\n      </Floating>\n\n      <Floating reduce={reduce} delay={0.25} className=\"absolute -left-6 top-20 hidden w-56 @xl:block\">\n        <div className=\"flex items-start gap-3 rounded-md bg-surface-raised p-3 shadow-md\">\n          <span className=\"grid size-7 shrink-0 place-items-center rounded-full bg-volt-soft text-volt-ink\">\n            <Check className=\"size-3.5\" strokeWidth={2.5} />\n          </span>\n          <div className=\"min-w-0\">\n            <div className=\"text-[13px] font-semibold text-ink\">Deployed to production</div>\n            <div className=\"text-[11.5px] text-ink-muted\">main · 41s ago</div>\n          </div>\n        </div>\n      </Floating>\n\n      <Floating reduce={reduce} delay={0.4} drift={10} className=\"absolute -right-6 -top-6 hidden w-44 @xl:block\">\n        <div className=\"grid gap-1 rounded-md bg-surface-raised p-3 shadow-md\">\n          <span className=\"text-[11px] font-medium text-ink-muted\">Components shipped</span>\n          <NumberTicker value={214} className=\"font-display text-2xl font-semibold text-ink\" />\n          <span className=\"inline-flex items-center gap-1 text-[11px] font-medium text-success\">\n            <Sparkles className=\"size-3\" /> 12 this week\n          </span>\n        </div>\n      </Floating>\n\n      <Floating reduce={reduce} delay={0.55} drift={6} className=\"absolute -bottom-6 right-10 hidden @xl:block\">\n        <div className=\"inline-flex items-center gap-2 rounded-full border border-border bg-glass px-3 py-2 text-[12px] font-medium text-ink shadow-md glass\">\n          <GitBranch className=\"size-3.5 text-volt-ink\" /> feat/hero-section\n          <span className=\"rounded-full bg-success/15 px-1.5 text-[10px] font-semibold uppercase text-success\">Merged</span>\n        </div>\n      </Floating>\n    </div>\n  );\n}\n\n/** Marketing hero: pulsing announcement pill, word-by-word headline with a marked word, two CTAs, a copyable install command and a floating product shot. */\nexport function HeroSection({\n  variant = \"centered\",\n  eyebrow = \"New: 14 page-section blocks\",\n  eyebrowBadge = \"New\",\n  eyebrowHref,\n  headline = \"Animated components your users will feel\",\n  mark = \"feel\",\n  subcopy = \"Copy-paste React components with spring motion, real keyboard support and tokens that match your brand. Built on Tailwind and motion.\",\n  primaryAction = { label: \"Browse components\" },\n  secondaryAction = { label: \"Read the docs\" },\n  installCommand = \"npx shadcn@latest add @geturui/hero-section\",\n  showProductShot = true,\n  className,\n}: HeroSectionProps) {\n  const reduce = useReducedMotionSafe();\n  const split = variant === \"split\";\n\n  const pillInner = (\n    <>\n      <Badge tone=\"new\" pulse>\n        {eyebrowBadge}\n      </Badge>\n      <span className=\"truncate\">{eyebrow}</span>\n      <ArrowRight aria-hidden className=\"size-3.5 shrink-0 text-ink-subtle transition-transform duration-300 ease-[var(--ease-spring)] group-hover/pill:translate-x-0.5\" />\n    </>\n  );\n  const pillClass =\n    \"group/pill inline-flex max-w-full items-center gap-2 rounded-full border border-border bg-surface py-1 pl-1 pr-3 text-[13px] font-medium text-ink-muted outline-none transition-colors hover:border-border-strong hover:text-ink focus-visible:shadow-[var(--focus-ring)]\";\n\n  return (\n    <section className={cn(\"@container relative w-full overflow-hidden px-4 py-16 sm:px-6 sm:py-24\", className)}>\n      <div\n        className={cn(\n          \"mx-auto grid max-w-6xl gap-14\",\n          split ? \"items-center @4xl:grid-cols-[1.05fr_1fr] @4xl:gap-10\" : \"justify-items-center text-center\",\n        )}\n      >\n        <div className={cn(\"flex flex-col gap-6\", split ? \"items-start\" : \"items-center\")}>\n          {eyebrow &&\n            (eyebrowHref ? (\n              <motion.a\n                href={eyebrowHref}\n                className={pillClass}\n                initial={{ opacity: 0, y: 8 }}\n                animate={{ opacity: 1, y: 0 }}\n                transition={{ type: \"spring\", stiffness: 300, damping: 30 }}\n              >\n                {pillInner}\n              </motion.a>\n            ) : (\n              <motion.span\n                className={pillClass}\n                initial={{ opacity: 0, y: 8 }}\n                animate={{ opacity: 1, y: 0 }}\n                transition={{ type: \"spring\", stiffness: 300, damping: 30 }}\n              >\n                {pillInner}\n              </motion.span>\n            ))}\n\n          <RevealText\n            as=\"h1\"\n            text={headline}\n            mark={mark}\n            delay={0.1}\n            className={cn(\n              \"text-balance font-display text-[40px] font-semibold leading-[1.05] tracking-[-1.2px] text-ink @xl:text-[56px] @xl:tracking-[-1.8px]\",\n              split ? \"max-w-xl\" : \"max-w-3xl @4xl:text-[68px] @4xl:tracking-[-2.2px]\",\n            )}\n          />\n\n          <motion.p\n            className={cn(\"text-balance text-base leading-7 text-ink-muted @xl:text-lg\", split ? \"max-w-lg\" : \"max-w-xl\")}\n            initial={{ opacity: 0, y: 10, filter: \"blur(6px)\" }}\n            animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n            transition={{ duration: 0.6, ease: [0.22, 1, 0.36, 1], delay: 0.45 }}\n          >\n            {subcopy}\n          </motion.p>\n\n          <motion.div\n            className={cn(\"flex flex-wrap items-center gap-3\", split ? \"justify-start\" : \"justify-center\")}\n            initial={{ opacity: 0, y: 10 }}\n            animate={{ opacity: 1, y: 0 }}\n            transition={{ type: \"spring\", stiffness: 300, damping: 30, delay: 0.55 }}\n          >\n            <Cta action={primaryAction} variant=\"primary\" />\n            <Cta action={secondaryAction} variant=\"secondary\" />\n          </motion.div>\n\n          {installCommand && (\n            <motion.div\n              className=\"inline-flex h-10 max-w-full items-center gap-2 rounded-full border border-border bg-surface-sunken pl-4 pr-1 font-mono text-[12.5px] text-ink-muted\"\n              initial={{ opacity: 0 }}\n              animate={{ opacity: 1 }}\n              transition={{ duration: 0.4, delay: 0.7 }}\n            >\n              <span aria-hidden className=\"text-volt-ink\">\n                $\n              </span>\n              <code className=\"truncate\">{installCommand}</code>\n              <CopyButton value={installCommand} label=\"Copy install command\" className=\"rounded-full\" />\n            </motion.div>\n          )}\n        </div>\n\n        {showProductShot && <ProductShot reduce={reduce} className={split ? \"@4xl:max-w-none\" : \"mt-4\"} />}\n      </div>\n    </section>\n  );\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","hero","landing","marketing","headline","cta","install","product shot"],"meta":{"tier":"free","license":"MIT","docs":"https://geturui.com/docs/hero-section"}}