{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navbar-1",
  "type": "registry:block",
  "title": "Navbar 1",
  "description": "Sticky navbar with blur-on-scroll, desktop links and a full-screen mobile menu.",
  "registryDependencies": [
    "button"
  ],
  "files": [
    {
      "path": "app/preview/navbar/one/page.tsx",
      "content": "'use client'\n\nimport { useEffect, useState } from 'react'\nimport Link from 'next/link'\nimport { Menu, X } from 'lucide-react'\nimport { Logo } from '@/components/logo'\nimport { Button } from '@/components/ui/button'\nimport { cn } from '@/lib/utils'\n\nconst links = [\n    { label: 'Product', href: '#' },\n    { label: 'Solutions', href: '#' },\n    { label: 'Pricing', href: '#' },\n    { label: 'Docs', href: '#' },\n    { label: 'Changelog', href: '#' },\n]\n\nexport default function Navbar() {\n    const [open, setOpen] = useState(false)\n    const [scrolled, setScrolled] = useState(false)\n\n    useEffect(() => {\n        const onScroll = () => setScrolled(window.scrollY > 8)\n        onScroll()\n        window.addEventListener('scroll', onScroll, { passive: true })\n        return () => window.removeEventListener('scroll', onScroll)\n    }, [])\n\n    // The mobile menu is lg:hidden, so close it (and release the scroll lock) when the viewport grows past lg.\n    useEffect(() => {\n        const mq = window.matchMedia('(min-width: 1024px)')\n        const onChange = (e: MediaQueryListEvent) => e.matches && setOpen(false)\n        mq.addEventListener('change', onChange)\n        return () => mq.removeEventListener('change', onChange)\n    }, [])\n\n    // Lock page scroll while the mobile menu is open.\n    useEffect(() => {\n        document.body.style.overflow = open ? 'hidden' : ''\n        return () => {\n            document.body.style.overflow = ''\n        }\n    }, [open])\n\n    return (\n        <>\n            <header className={cn('sticky top-0 z-50 w-full border-b border-transparent transition-colors duration-300', (scrolled || open) && 'bg-background/80 border-border backdrop-blur-lg')}>\n                <nav\n                    aria-label=\"Main\"\n                    className=\"mx-auto flex h-16 max-w-6xl items-center justify-between gap-6 px-6\">\n                    <Link\n                        href=\"/\"\n                        aria-label=\"Home\"\n                        className=\"flex items-center gap-2 font-semibold\">\n                        <Logo />\n                        <span>Lyra</span>\n                    </Link>\n\n                    <ul className=\"hidden items-center gap-1 lg:flex\">\n                        {links.map((link) => (\n                            <li key={link.label}>\n                                <Link\n                                    href={link.href}\n                                    className=\"text-muted-foreground hover:text-foreground hover:bg-accent rounded-md px-3 py-2 text-sm transition-colors\">\n                                    {link.label}\n                                </Link>\n                            </li>\n                        ))}\n                    </ul>\n\n                    <div className=\"hidden items-center gap-2 lg:flex\">\n                        <Button\n                            asChild\n                            variant=\"ghost\"\n                            size=\"sm\">\n                            <Link href=\"#\">Log in</Link>\n                        </Button>\n                        <Button\n                            asChild\n                            size=\"sm\">\n                            <Link href=\"#\">Get started</Link>\n                        </Button>\n                    </div>\n\n                    <Button\n                        variant=\"ghost\"\n                        size=\"icon\"\n                        className=\"lg:hidden\"\n                        aria-expanded={open}\n                        aria-controls=\"mobile-menu\"\n                        aria-label={open ? 'Close menu' : 'Open menu'}\n                        onClick={() => setOpen((v) => !v)}>\n                        {open ? <X className=\"size-5\" /> : <Menu className=\"size-5\" />}\n                    </Button>\n                </nav>\n\n                {open && (\n                    <div\n                        id=\"mobile-menu\"\n                        className=\"bg-background h-[calc(100dvh-4rem)] overflow-y-auto border-t px-6 pb-8 lg:hidden\">\n                        <ul className=\"divide-y\">\n                            {links.map((link) => (\n                                <li key={link.label}>\n                                    <Link\n                                        href={link.href}\n                                        onClick={() => setOpen(false)}\n                                        className=\"block py-4 text-lg font-medium\">\n                                        {link.label}\n                                    </Link>\n                                </li>\n                            ))}\n                        </ul>\n                        <div className=\"mt-6 grid gap-3\">\n                            <Button\n                                asChild\n                                variant=\"outline\"\n                                size=\"lg\">\n                                <Link href=\"#\">Log in</Link>\n                            </Button>\n                            <Button\n                                asChild\n                                size=\"lg\">\n                                <Link href=\"#\">Get started</Link>\n                            </Button>\n                        </div>\n                    </div>\n                )}\n            </header>\n\n            {/* Demo content so the sticky, blur-on-scroll behaviour is visible in the preview. */}\n            <main className=\"mx-auto max-w-6xl px-6 py-24\">\n                <h1 className=\"max-w-xl text-balance text-4xl font-semibold\">Scroll to see the header blur in.</h1>\n                <div className=\"mt-12 grid gap-4 sm:grid-cols-2\">\n                    {Array.from({ length: 6 }).map((_, i) => (\n                        <div\n                            key={i}\n                            className=\"bg-muted/50 h-48 rounded-xl border\"\n                        />\n                    ))}\n                </div>\n            </main>\n        </>\n    )\n}\n",
      "type": "registry:component",
      "target": "components/navbar-1.tsx"
    },
    {
      "path": "components/logo.tsx",
      "content": "import { cn } from '@/lib/utils'\n\n/**\n * Brand mark: four blocks, two squared and two rounded, stacked on a grid.\n * Purely presentational — wrap it in your own <Link> where it should navigate.\n */\nexport function Logo({ className }: { className?: string }) {\n    return (\n        <svg\n            viewBox=\"0 0 24 24\"\n            fill=\"none\"\n            aria-hidden=\"true\"\n            className={cn('size-6 text-foreground', className)}>\n            <rect\n                x=\"2\"\n                y=\"2\"\n                width=\"9\"\n                height=\"9\"\n                rx=\"2.25\"\n                fill=\"currentColor\"\n            />\n            <rect\n                x=\"13\"\n                y=\"2\"\n                width=\"9\"\n                height=\"9\"\n                rx=\"4.5\"\n                fill=\"currentColor\"\n                fillOpacity=\".3\"\n            />\n            <rect\n                x=\"2\"\n                y=\"13\"\n                width=\"9\"\n                height=\"9\"\n                rx=\"4.5\"\n                fill=\"currentColor\"\n                fillOpacity=\".3\"\n            />\n            <rect\n                x=\"13\"\n                y=\"13\"\n                width=\"9\"\n                height=\"9\"\n                rx=\"2.25\"\n                fill=\"currentColor\"\n            />\n        </svg>\n    )\n}\n",
      "type": "registry:component"
    }
  ]
}