{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "link-preview-demo",
  "title": "Link Preview Demo",
  "description": "A worked example of Link Preview: An inline link that shows where it leads before you follow it: an image, the title, a description, and the domain.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/link-preview.json"
  ],
  "files": [
    {
      "path": "components/demos/link-preview-demo.tsx",
      "content": "\"use client\"\n\nimport {\n  LinkPreview,\n  type LinkPreviewData,\n} from \"@/registry/default/link-preview/link-preview\"\n\nconst pages: Record<string, LinkPreviewData> = {\n  \"/docs/components/floating-index\": {\n    title: \"Floating Index\",\n    description:\n      \"A compact outline for long pages. It keeps the active section and reading progress visible without becoming another permanent sidebar.\",\n    image: \"/demo/gallery/floating-index.png\",\n  },\n  \"/docs/components/shift-button\": {\n    title: \"Shift Button\",\n    description:\n      \"A call to action that trades its leading icon for a directional cue when someone approaches it.\",\n    image: \"/demo/gallery/shift-button.png\",\n  },\n}\n\nasync function loadPreview(href: string) {\n  await new Promise((resolve) => setTimeout(resolve, 700))\n  const page = pages[href]\n  if (!page) throw new Error(`No preview for ${href}`)\n  return page\n}\n\nexport function LinkPreviewDemo() {\n  return (\n    <div className=\"w-full max-w-[34rem] text-sm leading-relaxed\">\n      <p>\n        Long pages need a way to see where you are. The{\" \"}\n        <LinkPreview\n          href=\"/docs/components/floating-index\"\n          loadPreview={loadPreview}\n        >\n          Floating Index\n        </LinkPreview>{\" \"}\n        keeps the outline close without taking a column, and a{\" \"}\n        <LinkPreview\n          href=\"/docs/components/shift-button\"\n          preview={pages[\"/docs/components/shift-button\"]}\n        >\n          Shift Button\n        </LinkPreview>{\" \"}\n        at the end tells people what comes next.\n      </p>\n      <p className=\"text-muted-foreground mt-3 text-xs\">\n        Rest the pointer on a link, or tab to it. The first preview loads, the\n        second is already known. On a touch screen the links simply open.\n      </p>\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}