{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "floating-index-demo",
  "title": "Floating Index Demo",
  "description": "A worked example of Floating Index: A compact outline for long pages. It keeps the active section and reading progress visible without becoming another permanent sidebar.",
  "dependencies": [
    "lucide-react@^1.31.0"
  ],
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/floating-index.json"
  ],
  "files": [
    {
      "path": "components/demos/floating-index-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { BookOpen, CheckCircle2, SlidersHorizontal } from \"lucide-react\"\n\nimport { FloatingIndex } from \"@/registry/default/floating-index/floating-index\"\n\nconst items = [\n  {\n    id: \"floating-index-introduction\",\n    label: \"Introduction\",\n    icon: <BookOpen aria-hidden=\"true\" />,\n  },\n  {\n    id: \"floating-index-behavior\",\n    label: \"Behavior\",\n    icon: <SlidersHorizontal aria-hidden=\"true\" />,\n  },\n  {\n    id: \"floating-index-finish\",\n    label: \"Finish\",\n    icon: <CheckCircle2 aria-hidden=\"true\" />,\n  },\n]\n\nconst sections = [\n  {\n    id: \"floating-index-introduction\",\n    kicker: \"01\",\n    title: \"Keep your place.\",\n    copy: \"The index stays close while the page keeps moving.\",\n  },\n  {\n    id: \"floating-index-behavior\",\n    kicker: \"02\",\n    title: \"See where you are.\",\n    copy: \"Open it for the full outline, or glance at the progress ring.\",\n  },\n  {\n    id: \"floating-index-finish\",\n    kicker: \"03\",\n    title: \"Jump without getting lost.\",\n    copy: \"Choose a section and the index follows you there.\",\n  },\n]\n\nexport function FloatingIndexDemo() {\n  const containerRef = React.useRef<HTMLDivElement>(null)\n\n  return (\n    <div\n      ref={containerRef}\n      className=\"bg-background relative h-[28rem] w-full max-w-xl overflow-y-auto rounded-[var(--radius)] border\"\n    >\n      <FloatingIndex\n        items={items}\n        containerRef={containerRef}\n        className=\"sticky top-4 left-auto mx-auto translate-x-0\"\n      />\n\n      <div className=\"-mt-11\">\n        {sections.map((section, index) => (\n          <section\n            className=\"flex min-h-[25rem] scroll-mt-4 flex-col justify-end border-b p-8 last:border-b-0\"\n            id={section.id}\n            key={section.id}\n          >\n            <p className=\"text-primary text-xs font-bold tracking-[0.08em]\">\n              {section.kicker}\n            </p>\n            <h3 className=\"mt-3 font-[family-name:var(--font-display)] text-4xl font-semibold tracking-[-0.04em]\">\n              {section.title}\n            </h3>\n            <p className=\"text-muted-foreground mt-3 max-w-sm leading-relaxed\">\n              {section.copy}\n            </p>\n            {index === 0 && (\n              <p className=\"text-muted-foreground mt-8 text-xs\">\n                Scroll this frame to try it.\n              </p>\n            )}\n          </section>\n        ))}\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}