{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "scroll-to-top-button-demo",
  "title": "Scroll to Top Button Demo",
  "description": "A worked example of Scroll to Top Button: A floating way back after someone has moved down a long page or scroll area. It stays hidden near the top.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/scroll-to-top-button.json"
  ],
  "files": [
    {
      "path": "components/demos/scroll-to-top-button-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { ScrollToTopButton } from \"@/registry/default/scroll-to-top-button/scroll-to-top-button\"\n\nconst sections = [\n  [\"Start with the purpose\", \"Say what the page helps someone do.\"],\n  [\"Keep the path clear\", \"One primary action is usually enough.\"],\n  [\"Show the real thing\", \"A working example beats another promise.\"],\n  [\"Answer the practical bits\", \"Cover setup, ownership, and access.\"],\n  [\"Finish usefully\", \"End with the next step and a way back.\"],\n] as const\n\nexport function ScrollToTopDemo() {\n  const containerRef = React.useRef<HTMLDivElement>(null)\n\n  return (\n    <div className=\"bg-background border-border relative h-80 w-full max-w-[32rem] overflow-hidden rounded-[1.25rem] border shadow-sm\">\n      <div\n        className=\"h-full overflow-y-auto px-5 py-6 md:px-8\"\n        ref={containerRef}\n      >\n        <p className=\"text-muted-foreground text-sm font-semibold\">\n          A short page about long pages\n        </p>\n        <h3 className=\"mt-2 text-2xl font-semibold\">\n          Give every section a job.\n        </h3>\n        <div className=\"mt-8 grid gap-10 pb-8\">\n          {sections.map(([title, description], index) => (\n            <section className=\"border-border border-t pt-5\" key={title}>\n              <p className=\"text-muted-foreground text-xs font-semibold tracking-[0.08em] uppercase\">\n                {String(index + 1).padStart(2, \"0\")}\n              </p>\n              <h4 className=\"mt-2 font-semibold\">{title}</h4>\n              <p className=\"text-muted-foreground mt-1 text-sm leading-relaxed\">\n                {description}\n              </p>\n            </section>\n          ))}\n        </div>\n      </div>\n      <ScrollToTopButton\n        className=\"absolute right-4 bottom-4\"\n        containerRef={containerRef}\n        showAfter={120}\n      />\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}