{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sheet-nav-mobile",
  "title": "Sheet Nav Mobile",
  "description": "The phone navigation menu: a labelled hamburger button opens a left sheet with the site links, marks the current page and closes with focus returned on navigate.",
  "registryDependencies": [
    "button",
    "sheet"
  ],
  "files": [
    {
      "path": "registry/patterns/sheet-nav-mobile/sheet-nav-mobile.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { MenuIcon } from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Sheet,\n  SheetContent,\n  SheetDescription,\n  SheetHeader,\n  SheetTitle,\n  SheetTrigger,\n} from \"@/components/ui/sheet\"\n\nexport interface NavLink {\n  href: string\n  label: string\n}\n\nexport interface SheetNavMobileProps {\n  links: NavLink[]\n  /** The href of the current page, marked with `aria-current=\"page\"`. */\n  current: string\n  /** Called when a link is chosen; the sheet closes. Use it for client routing. */\n  onNavigate?: (href: string) => void\n  title?: string\n}\n\n/**\n * The phone navigation menu: a hamburger button opens a sheet with the site's\n * links. The button says \"Open menu\" and reports `aria-expanded`, the current\n * page is marked with `aria-current=\"page\"`, choosing a link closes the sheet,\n * and focus returns to the button.\n */\nexport function SheetNavMobile({\n  links,\n  current,\n  onNavigate,\n  title = \"Menu\",\n}: SheetNavMobileProps) {\n  const [open, setOpen] = React.useState(false)\n  return (\n    <Sheet open={open} onOpenChange={setOpen}>\n      <SheetTrigger asChild>\n        <Button\n          variant=\"outline\"\n          size=\"icon\"\n          aria-label=\"Open menu\"\n          aria-expanded={open}\n        >\n          <MenuIcon aria-hidden=\"true\" />\n        </Button>\n      </SheetTrigger>\n      <SheetContent side=\"left\" className=\"w-72\">\n        <SheetHeader>\n          <SheetTitle>{title}</SheetTitle>\n          <SheetDescription className=\"sr-only\">\n            Site navigation\n          </SheetDescription>\n        </SheetHeader>\n        <nav aria-label=\"Main\" className=\"grid gap-1 px-2\">\n          {links.map((link) => (\n            <a\n              key={link.href}\n              href={link.href}\n              aria-current={link.href === current ? \"page\" : undefined}\n              onClick={(event) => {\n                if (onNavigate) {\n                  event.preventDefault()\n                  onNavigate(link.href)\n                }\n                setOpen(false)\n              }}\n              className=\"hover:bg-accent focus-visible:ring-ring aria-[current=page]:bg-accent rounded-md px-3 py-2 text-sm outline-none focus-visible:ring-2 aria-[current=page]:font-medium\"\n            >\n              {link.label}\n            </a>\n          ))}\n        </nav>\n      </SheetContent>\n    </Sheet>\n  )\n}\n",
      "type": "registry:block"
    }
  ],
  "type": "registry:block"
}