{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sticky-cta-bar",
  "title": "Sticky CTA Bar",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/sticky-cta-bar/StickyCtaBar.tsx",
      "content": "'use client'\n\nimport { useEffect, useRef, useState } from 'react'\nimport { Clock, X } from 'lucide-react'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Separator } from '@/components/ui/separator'\n\ninterface StickyCtaBarProps {\n  /** Scroll distance in pixels before the bar reveals. */\n  threshold?: number\n  /** sessionStorage key holding the dismissal, so it stays closed for the session. */\n  storageKey?: string\n}\n\nexport function StickyCtaBar({ threshold = 480, storageKey = 'uipkge:sticky-cta-dismissed' }: StickyCtaBarProps) {\n  // Starts hidden so server and first client render agree — the scroll handler\n  // is the only thing that reveals it.\n  const [visible, setVisible] = useState(false)\n  const dismissed = useRef(false)\n\n  useEffect(() => {\n    try {\n      dismissed.current = window.sessionStorage.getItem(storageKey) === '1'\n    } catch {\n      dismissed.current = false\n    }\n\n    const onScroll = () => setVisible(!dismissed.current && window.scrollY > threshold)\n    onScroll()\n    window.addEventListener('scroll', onScroll, { passive: true })\n    return () => window.removeEventListener('scroll', onScroll)\n  }, [threshold, storageKey])\n\n  function dismiss() {\n    dismissed.current = true\n    setVisible(false)\n    try {\n      window.sessionStorage.setItem(storageKey, '1')\n    } catch {\n      // Private browsing or blocked storage: dismissing still holds for this page view.\n    }\n  }\n\n  return (\n    <div\n      data-slot=\"sticky-cta-bar\"\n      className={`fixed inset-x-0 bottom-0 z-50 px-4 pb-4 transition duration-200 ${\n        visible ? 'translate-y-0 opacity-100' : 'pointer-events-none invisible translate-y-full opacity-0'\n      }`}\n      role=\"region\"\n      aria-label=\"Trial offer\"\n      aria-hidden={!visible}\n    >\n      <div className=\"border-border bg-card/95 mx-auto flex max-w-4xl flex-wrap items-center gap-x-5 gap-y-3 rounded-xl border p-3 pl-4 shadow-lg backdrop-blur\">\n        <Badge variant=\"secondary\" className=\"gap-1.5\">\n          <Clock className=\"size-3\" aria-hidden=\"true\" />\n          Free for 14 days\n        </Badge>\n\n        <p className=\"min-w-0 grow text-sm\">\n          <span className=\"font-medium\">Start on the full plan.</span>\n          <span className=\"text-muted-foreground\"> No card, no sales call, cancel from the dashboard.</span>\n        </p>\n\n        <div className=\"flex items-center gap-2\">\n          <Button size=\"sm\">Start free trial</Button>\n          <Button size=\"sm\" variant=\"ghost\" className=\"hidden sm:inline-flex\">\n            Talk to us\n          </Button>\n          <Separator orientation=\"vertical\" className=\"hidden h-6 sm:block\" />\n          <Button size=\"icon\" variant=\"ghost\" aria-label=\"Dismiss this offer\" onClick={dismiss}>\n            <X className=\"size-4\" aria-hidden=\"true\" />\n          </Button>\n        </div>\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/StickyCtaBar.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/separator.json"
  ],
  "description": "Scroll-triggered bottom CTA bar that reveals past a threshold, carrying an offer line, inline social proof, primary + ghost actions, and a dismiss control that stays dismissed for the session.",
  "categories": [
    "marketing"
  ],
  "deprecated": true,
  "replacedBy": "sticky-cta"
}