{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "table-of-contents-demo",
  "title": "Table of Contents Demo",
  "description": "A worked example of Table of Contents: An outline of the page that keeps up with the reader, marking the section they are in as they scroll.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/table-of-contents.json"
  ],
  "files": [
    {
      "path": "components/demos/table-of-contents-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { TableOfContents } from \"@/registry/default/table-of-contents/table-of-contents\"\n\nconst sections = [\n  { id: \"toc-demo-install\", label: \"Install\" },\n  { id: \"toc-demo-usage\", label: \"Usage\" },\n  { id: \"toc-demo-api\", label: \"API\" },\n]\n\nexport function TableOfContentsDemo() {\n  return (\n    <div className=\"grid w-full max-w-lg gap-4 sm:grid-cols-[1fr_9rem]\">\n      <div className=\"border-border h-64 overflow-y-auto rounded-[var(--radius)] border p-4\">\n        {sections.map((section) => (\n          <section key={section.id} id={section.id} className=\"mb-6 last:mb-0\">\n            <h3 className=\"text-sm font-semibold\">{section.label}</h3>\n            <p className=\"text-muted-foreground mt-1 text-sm leading-relaxed\">\n              Scroll this panel to watch the outline keep up. Sections here are\n              deliberately uneven, which is what makes the tracking worth doing\n              properly.\n            </p>\n            <p className=\"text-muted-foreground mt-2 text-sm leading-relaxed\">\n              The outline marks whichever heading was passed most recently.\n            </p>\n          </section>\n        ))}\n      </div>\n\n      <TableOfContents className=\"hidden sm:grid\" sections={sections} />\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}