{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "morph-search-docs-demo",
  "type": "registry:block",
  "title": "Morph Search: Docs Search",
  "description": "Expanding Search Bar example, Docs Search: A docs header with a fake search field that becomes the real one. Press / to open it from anywhere. A take on the search bar (search box). Fits navbar, docs and app UI sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "navbar",
    "docs",
    "app-ui",
    "search-bar",
    "search",
    "command-menu",
    "motion"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/morph-search#morph-search-docs-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/morph-search.json"
  ],
  "files": [
    {
      "path": "components/morph-search-docs-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nimport { MorphSearch, MorphSearchIcon, type MorphSearchItem } from \"@/components/ui/morph-search\";\n\nconst page = (\n  <svg aria-hidden viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n    <path d=\"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9ZM14 3v6h6\" />\n  </svg>\n);\nconst heading = (\n  <svg aria-hidden viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\">\n    <path d=\"M4 9h16M4 15h16M10 3 8 21M16 3l-2 18\" />\n  </svg>\n);\n\nconst docs: MorphSearchItem[] = [\n  { id: \"introduction\", group: \"Getting started\", label: \"Introduction\", description: \"What Glide is, and isn't\", icon: page },\n  { id: \"installation\", group: \"Getting started\", label: \"Installation\", description: \"Add Glide to Next.js or Vite\", icon: page, keywords: [\"install\", \"setup\", \"npm\"] },\n  { id: \"quick-start\", group: \"Getting started\", label: \"Quick start\", description: \"Your first component in five minutes\", icon: page },\n  { id: \"cli\", group: \"Getting started\", label: \"CLI\", description: \"Commands and flags\", icon: page, keywords: [\"terminal\"] },\n  { id: \"button\", group: \"Components\", label: \"Button\", description: \"Actions, links and loading states\", icon: page },\n  { id: \"dialog\", group: \"Components\", label: \"Dialog\", description: \"Modal windows that trap focus\", icon: page, keywords: [\"modal\"] },\n  { id: \"popover\", group: \"Components\", label: \"Popover\", description: \"Floating panels anchored to a trigger\", icon: page },\n  { id: \"tabs\", group: \"Components\", label: \"Tabs\", description: \"Switch between related views\", icon: page },\n  { id: \"toast\", group: \"Components\", label: \"Toast\", description: \"Brief, non-blocking messages\", icon: page, keywords: [\"notification\"] },\n  { id: \"theming\", group: \"Guides\", label: \"Theming\", description: \"Colors, radii and fonts\", icon: page, keywords: [\"css\", \"tokens\"] },\n  { id: \"css-variables\", group: \"Guides\", label: \"CSS variables\", description: \"Theming\", icon: heading, keywords: [\"tokens\"] },\n  { id: \"dark-mode\", group: \"Guides\", label: \"Dark mode\", description: \"Follow the system or a toggle\", icon: page },\n  { id: \"animation\", group: \"Guides\", label: \"Animation\", description: \"Springs, easing and reduced motion\", icon: page, keywords: [\"motion\"] },\n  { id: \"reduced-motion\", group: \"Guides\", label: \"Reduced motion\", description: \"Animation\", icon: heading },\n];\n\nconst suggested = [\"installation\", \"dialog\", \"theming\", \"animation\"].map((id) => ({\n  ...docs.find((doc) => doc.id === id)!,\n  group: \"Suggested\",\n}));\n\nexport function MorphSearchDocsDemo() {\n  const [doc, setDoc] = React.useState(docs[0]);\n  const reduceMotion = useReducedMotion();\n\n  return (\n    <div className=\"w-full max-w-3xl overflow-hidden rounded-xl border border-zinc-200 bg-white dark:border-zinc-800 dark:bg-zinc-950\">\n      <header className=\"flex h-14 items-center gap-4 border-b border-zinc-200/80 px-4 dark:border-zinc-800/80\">\n        <span className=\"flex shrink-0 items-center gap-2 text-sm font-semibold text-zinc-900 dark:text-zinc-50\">\n          <span aria-hidden className=\"size-5 rounded-full bg-linear-to-br from-sky-400 to-emerald-400\" />\n          Glide\n          <span className=\"rounded-full bg-zinc-100 px-1.5 py-0.5 font-mono text-[10px] font-normal text-zinc-500 dark:bg-zinc-900\">\n            v3\n          </span>\n        </span>\n        <MorphSearch\n          variant=\"palette\"\n          hotkey=\"/\"\n          items={docs}\n          suggestions={suggested}\n          placeholder=\"Search documentation…\"\n          onSelect={(item) => setDoc(item)}\n          className=\"mx-auto h-9 w-full max-w-64 justify-start gap-2.5 rounded-lg bg-zinc-50 px-2.5 dark:bg-zinc-900/60\"\n        >\n          <MorphSearchIcon />\n          <span className=\"truncate\">Search docs…</span>\n          <kbd className=\"ml-auto rounded-[5px] bg-background px-1.5 py-0.5 font-mono text-[10.5px] ring-1 ring-foreground/10\">\n            /\n          </kbd>\n        </MorphSearch>\n        <span className=\"hidden shrink-0 text-sm text-zinc-500 sm:block\">GitHub</span>\n      </header>\n\n      <motion.article\n        key={doc.id}\n        initial={{ opacity: 0, y: reduceMotion ? 0 : 6 }}\n        animate={{ opacity: 1, y: 0 }}\n        transition={{ duration: 0.3, ease: \"easeOut\" }}\n        className=\"px-6 pt-10 pb-14 sm:px-10\"\n      >\n        <p className=\"text-xs text-zinc-500\">\n          Docs <span className=\"px-1 text-zinc-300 dark:text-zinc-700\">/</span> {doc.group}\n        </p>\n        <h2 className=\"mt-3 text-3xl font-semibold tracking-tight text-zinc-900 dark:text-zinc-50\">\n          {doc.label}\n        </h2>\n        <p className=\"mt-2 text-sm text-zinc-500\">{doc.description}.</p>\n        <div className=\"mt-8 space-y-2.5\">\n          {[\"w-full\", \"w-11/12\", \"w-4/5\", \"w-2/3\"].map((line) => (\n            <span key={line} className={`block h-2.5 rounded-full bg-zinc-100 dark:bg-zinc-900 ${line}`} />\n          ))}\n        </div>\n        <p className=\"mt-10 font-mono text-xs text-zinc-500\">Press / to search.</p>\n      </motion.article>\n    </div>\n  );\n}\n"
    }
  ]
}