{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sticky-deck-demo",
  "type": "registry:block",
  "title": "Sticky Deck: How It Works",
  "description": "Stacking Cards on Scroll example, How It Works: An AI agent's four steps, each card with a piece of real product UI. The step list beside the deck follows the front card through `onActiveChange`, and clicking a step scrolls there through `apiRef`. Hover an edge that peeks out above the front card and it lifts; click it to bring that card back. A take on the stacking cards (card stack) and scroll animation (on scroll). Fits features, testimonials and pricing sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "features",
    "testimonials",
    "pricing",
    "stacking-cards",
    "scroll-animation",
    "scroll",
    "cards",
    "sticky"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/sticky-deck#sticky-deck-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/sticky-deck.json"
  ],
  "files": [
    {
      "path": "components/sticky-deck-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { StickyDeck, StickyDeckCard, type StickyDeckApi } from \"@/components/ui/sticky-deck\";\n\nconst steps = [\n  {\n    title: \"Connect\",\n    heading: \"Plug in the tools you already use\",\n    body: \"Sign in with GitHub and pick the repos. Slack, Linear and your database connect in a click, read-only until you say otherwise.\",\n    art: <ConnectArt />,\n  },\n  {\n    title: \"Configure\",\n    heading: \"Tell it how your team works\",\n    body: \"Set how far the agent goes on its own, who reviews what, and where it reports. Plain toggles, no YAML.\",\n    art: <ConfigureArt />,\n  },\n  {\n    title: \"Ship\",\n    heading: \"Watch it open the pull request\",\n    body: \"It writes the fix, runs your tests and deploys a preview. You get a PR with the reasoning attached.\",\n    art: <ShipArt />,\n  },\n  {\n    title: \"Learn\",\n    heading: \"It gets faster every week\",\n    body: \"Every review teaches it your conventions. Most teams see time to merge drop within the first month.\",\n    art: <LearnArt />,\n  },\n];\n\n// For a full-page section, drop the scroll box and `containerRef`: the deck\n// then pins against the window.\nexport function StickyDeckDemo() {\n  const scrollRef = React.useRef<HTMLDivElement>(null);\n  const deckRef = React.useRef<StickyDeckApi>(null);\n  const [active, setActive] = React.useState(0);\n\n  return (\n    <div className=\"relative w-full overflow-hidden rounded-xl border border-zinc-200 bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-950\">\n      <div\n        ref={scrollRef}\n        className=\"@container relative h-[var(--demo-height,36rem)] overflow-y-auto overscroll-contain\"\n      >\n        <div className=\"mx-auto max-w-4xl px-4 @lg:px-8\">\n          <header className=\"pt-14 pb-12 @lg:pt-20\">\n            <p className=\"font-mono text-[11px] tracking-widest text-zinc-500 uppercase\">How it works</p>\n            <h2 className=\"mt-3 max-w-md text-3xl/tight font-semibold tracking-tight text-balance text-zinc-900 dark:text-zinc-50\">\n              From a connected repo to a merged fix in four steps\n            </h2>\n            <p className=\"mt-3 max-w-md text-sm/6 text-pretty text-zinc-500\">\n              Scroll through the deck. Click an edge that peeks out above the front card to go back to it.\n            </p>\n          </header>\n\n          <div className=\"grid gap-8 @3xl:grid-cols-[10rem_1fr]\">\n            <nav aria-label=\"Steps\" className=\"sticky top-24 hidden self-start @3xl:block\">\n              <ol className=\"space-y-1\">\n                {steps.map((step, index) => (\n                  <li key={step.title}>\n                    <button\n                      type=\"button\"\n                      onClick={() => deckRef.current?.scrollTo(index)}\n                      aria-current={active === index ? \"step\" : undefined}\n                      className={cn(\n                        \"group flex w-full items-center gap-3 rounded-lg py-1.5 text-left text-sm transition-colors duration-200\",\n                        active === index\n                          ? \"text-zinc-900 dark:text-zinc-50\"\n                          : \"text-zinc-400 hover:text-zinc-600 dark:text-zinc-600 dark:hover:text-zinc-400\",\n                      )}\n                    >\n                      <span className=\"font-mono text-[11px] tabular-nums\">{String(index + 1).padStart(2, \"0\")}</span>\n                      <span className=\"font-medium\">{step.title}</span>\n                      <span\n                        className={cn(\n                          \"ml-auto h-px bg-current transition-[width] duration-300 ease-out\",\n                          active === index ? \"w-6\" : \"w-0\",\n                        )}\n                      />\n                    </button>\n                  </li>\n                ))}\n              </ol>\n            </nav>\n\n            <StickyDeck containerRef={scrollRef} apiRef={deckRef} onActiveChange={setActive} top={96}>\n              {steps.map((step, index) => (\n                <StickyDeckCard\n                  key={step.title}\n                  className=\"flex h-[min(16rem,calc(var(--demo-height,36rem)-8.5rem))] flex-col @md:h-[min(22rem,calc(var(--demo-height,36rem)-8.5rem))] gap-6 overflow-hidden rounded-2xl bg-white p-6 shadow-[0_-12px_32px_-16px_rgb(0_0_0/0.25)] ring-1 ring-zinc-900/[0.07] @2xl:flex-row @2xl:items-stretch @2xl:p-8 dark:bg-zinc-900 dark:shadow-[0_-12px_32px_-12px_rgb(0_0_0/0.8)] dark:ring-white/10\"\n                >\n                  <div className=\"flex min-w-0 flex-1 flex-col\">\n                    <p className=\"flex items-center gap-2 font-mono text-[11px] tracking-widest text-zinc-500 uppercase\">\n                      <span className=\"tabular-nums\">{String(index + 1).padStart(2, \"0\")}</span>\n                      <span className=\"h-px w-4 bg-zinc-300 dark:bg-zinc-700\" />\n                      {step.title}\n                    </p>\n                    <h3 className=\"mt-4 text-xl/snug font-semibold tracking-tight text-balance text-zinc-900 @2xl:text-2xl/snug dark:text-zinc-50\">\n                      {step.heading}\n                    </h3>\n                    <p className=\"mt-2 max-w-sm text-sm/6 text-pretty text-zinc-500\">{step.body}</p>\n                  </div>\n                  <div className=\"hidden min-h-0 flex-1 @md:flex @2xl:max-w-[18rem]\">{step.art}</div>\n                </StickyDeckCard>\n              ))}\n            </StickyDeck>\n          </div>\n\n          <footer className=\"flex h-[calc(var(--demo-height,36rem)-6rem)] flex-col items-center justify-center text-center\">\n            <h2 className=\"text-2xl font-semibold tracking-tight text-zinc-900 dark:text-zinc-50\">\n              Your first PR is ten minutes away\n            </h2>\n            <a\n              href=\"#\"\n              className=\"mt-5 rounded-full bg-zinc-900 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-zinc-700 dark:bg-white dark:text-zinc-900 dark:hover:bg-zinc-200\"\n            >\n              Connect a repo\n            </a>\n          </footer>\n        </div>\n      </div>\n    </div>\n  );\n}\n\n/* ── Card art: small pieces of product UI, not screenshots ── */\n\nconst panel =\n  \"flex w-full flex-col rounded-xl bg-zinc-50 p-3 ring-1 ring-zinc-900/[0.06] dark:bg-zinc-950 dark:ring-white/[0.06]\";\n\nfunction ConnectArt() {\n  const tools = [\n    { name: \"GitHub\", mark: \"bg-zinc-900 dark:bg-zinc-100\", on: true },\n    { name: \"Slack\", mark: \"bg-violet-500\", on: true },\n    { name: \"Linear\", mark: \"bg-indigo-500\", on: true },\n    { name: \"Postgres\", mark: \"bg-sky-600\", on: false },\n    { name: \"Sentry\", mark: \"bg-rose-500\", on: false },\n  ];\n  return (\n    <div className={panel}>\n      <p className=\"px-1 pb-2 text-[11px] font-medium text-zinc-500\">Integrations</p>\n      <ul className=\"flex flex-1 flex-col justify-between gap-1\">\n        {tools.map((tool) => (\n          <li\n            key={tool.name}\n            className=\"flex items-center gap-2.5 rounded-lg bg-white px-2.5 py-2 text-xs ring-1 ring-zinc-900/[0.05] dark:bg-zinc-900 dark:ring-white/[0.05]\"\n          >\n            <span className={cn(\"size-4 rounded-[5px]\", tool.mark)} />\n            <span className=\"font-medium text-zinc-800 dark:text-zinc-200\">{tool.name}</span>\n            {tool.on ? (\n              <span className=\"ml-auto flex items-center gap-1.5 text-zinc-500\">\n                <span className=\"size-1.5 rounded-full bg-emerald-500\" />\n                Connected\n              </span>\n            ) : (\n              <span className=\"ml-auto rounded-md bg-zinc-100 px-2 py-0.5 font-medium text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300\">\n                Connect\n              </span>\n            )}\n          </li>\n        ))}\n      </ul>\n    </div>\n  );\n}\n\nfunction ConfigureArt() {\n  const rules = [\n    { label: \"Draft PRs for small fixes\", on: true },\n    { label: \"Ask before touching migrations\", on: true },\n    { label: \"Post summaries to #eng\", on: false },\n  ];\n  return (\n    <div className={cn(panel, \"justify-between gap-3\")}>\n      <div>\n        <p className=\"px-1 pb-2 text-[11px] font-medium text-zinc-500\">Autonomy</p>\n        <div className=\"grid grid-cols-3 rounded-lg bg-zinc-200/70 p-0.5 text-center text-[11px] font-medium dark:bg-zinc-800\">\n          <span className=\"py-1 text-zinc-500\">Suggest</span>\n          <span className=\"rounded-md bg-white py-1 text-zinc-900 shadow-sm dark:bg-zinc-700 dark:text-zinc-50\">\n            Draft\n          </span>\n          <span className=\"py-1 text-zinc-500\">Merge</span>\n        </div>\n      </div>\n      <ul className=\"space-y-1\">\n        {rules.map((rule) => (\n          <li\n            key={rule.label}\n            className=\"flex items-center justify-between gap-3 rounded-lg bg-white px-2.5 py-2 text-xs text-zinc-700 ring-1 ring-zinc-900/[0.05] dark:bg-zinc-900 dark:text-zinc-300 dark:ring-white/[0.05]\"\n          >\n            {rule.label}\n            <span\n              className={cn(\n                \"flex h-4 w-7 shrink-0 items-center rounded-full p-0.5\",\n                rule.on ? \"justify-end bg-emerald-500\" : \"bg-zinc-300 dark:bg-zinc-700\",\n              )}\n            >\n              <span className=\"size-3 rounded-full bg-white shadow-sm\" />\n            </span>\n          </li>\n        ))}\n      </ul>\n    </div>\n  );\n}\n\nfunction ShipArt() {\n  const lines = [\n    { mark: \"✓\", text: \"Reproduced #1184 in a test\", tone: \"text-emerald-500\" },\n    { mark: \"✓\", text: \"Patched src/billing/proration.ts\", tone: \"text-emerald-500\" },\n    { mark: \"✓\", text: \"312 / 312 tests passed\", tone: \"text-emerald-500\" },\n    { mark: \"✓\", text: \"Preview deployed\", tone: \"text-emerald-500\" },\n    { mark: \"→\", text: \"Opened PR #482 for review\", tone: \"text-sky-500\" },\n  ];\n  return (\n    <div className=\"flex w-full flex-col justify-between rounded-xl bg-zinc-950 p-3 font-mono text-[11px] text-zinc-300 ring-1 ring-white/10\">\n      <p className=\"flex items-center gap-1.5 pb-2 text-zinc-500\">\n        <span className=\"size-1.5 rounded-full bg-emerald-500\" />\n        agent · fix/proration-rounding\n      </p>\n      <ul className=\"space-y-1.5\">\n        {lines.map((line) => (\n          <li key={line.text} className=\"flex gap-2\">\n            <span className={line.tone}>{line.mark}</span>\n            <span className=\"truncate\">{line.text}</span>\n          </li>\n        ))}\n      </ul>\n      <div className=\"mt-3 h-1 overflow-hidden rounded-full bg-white/10\">\n        <div className=\"h-full w-full rounded-full bg-emerald-500\" />\n      </div>\n    </div>\n  );\n}\n\nfunction LearnArt() {\n  const weeks = [62, 58, 51, 47, 40, 36, 31, 27];\n  return (\n    <div className={cn(panel, \"justify-between\")}>\n      <div className=\"px-1\">\n        <p className=\"text-[11px] font-medium text-zinc-500\">Median time to merge</p>\n        <p className=\"mt-1 flex items-baseline gap-2\">\n          <span className=\"text-2xl font-semibold tracking-tight text-zinc-900 tabular-nums dark:text-zinc-50\">\n            2.7h\n          </span>\n          <span className=\"text-xs font-medium text-emerald-600 dark:text-emerald-400\">−56%</span>\n        </p>\n      </div>\n      <div className=\"flex h-24 items-end gap-1.5 px-1\">\n        {weeks.map((value, index) => (\n          <span\n            key={index}\n            style={{ height: `${value * 1.4}%` }}\n            className={cn(\n              \"flex-1 rounded-t-[4px]\",\n              index === weeks.length - 1 ? \"bg-emerald-500\" : \"bg-zinc-200 dark:bg-zinc-800\",\n            )}\n          />\n        ))}\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}