{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "navbar-04", "type": "registry:block", "registryDependencies": [ "utils", "navigation-menu", "button", "popover" ], "files": [ { "path": "registry/default/blocks/navbar/navbar-04.tsx", "content": "import { buttonVariants } from '@/registry/default/ui/button'\r\nimport {\r\n NavigationMenu,\r\n NavigationMenuItem,\r\n NavigationMenuLink,\r\n NavigationMenuList,\r\n NavigationMenuContent,\r\n NavigationMenuTrigger,\r\n} from '@/registry/default/ui/navigation-menu'\r\nimport { cn } from '@/lib/utils'\r\nimport { MobileNav } from './mobile-nav'\r\n// import Link from 'next/link'\r\n\r\n// Sample navigation links, you can replace these with your actual links\r\nconst starterkits = [\r\n {\r\n title: 'Orbit',\r\n description: 'Personal portfolio starter template',\r\n href: '#',\r\n },\r\n {\r\n title: 'SaaS',\r\n description: 'Complete SaaS application starter',\r\n href: '#',\r\n },\r\n]\r\nconst components = [\r\n {\r\n title: 'Input',\r\n description: 'Form input components',\r\n href: '#',\r\n },\r\n {\r\n title: 'Dropdown Menu',\r\n description: 'Interactive dropdown menus',\r\n href: '#',\r\n },\r\n {\r\n title: 'View all',\r\n description: 'Browse all components',\r\n href: '#',\r\n },\r\n]\r\nconst blocks = [\r\n {\r\n title: 'Hero Section',\r\n description: 'Landing page hero blocks',\r\n href: '#',\r\n },\r\n {\r\n title: 'Navbars',\r\n description: 'Navigation bar components',\r\n href: '#',\r\n },\r\n {\r\n title: 'Sign-in and Sign-up',\r\n description: 'Authentication form blocks',\r\n href: '#',\r\n },\r\n]\r\nconst learning = [\r\n {\r\n title: 'Documentation',\r\n description: 'Complete guides and API reference',\r\n href: '#',\r\n },\r\n {\r\n title: 'Tutorials',\r\n description: 'Step-by-step learning materials',\r\n href: '#',\r\n },\r\n {\r\n title: 'Blog',\r\n description: 'Latest news and insights',\r\n href: '#',\r\n },\r\n]\r\nconst support = [\r\n {\r\n title: 'Community',\r\n description: 'Join our developer community',\r\n href: '#',\r\n },\r\n {\r\n title: 'Help Center',\r\n description: 'Find answers to common questions',\r\n href: '#',\r\n },\r\n {\r\n title: 'Contact',\r\n description: 'Get in touch with our team',\r\n href: '#',\r\n },\r\n]\r\n\r\nconst navigationLinks = {\r\n mobile: [\r\n {\r\n name: 'Menu',\r\n items: [\r\n { href: '#', label: 'Docs' },\r\n { href: '#', label: 'Pricing' },\r\n ],\r\n },\r\n {\r\n name: 'Starterkits',\r\n items: starterkits.map((item) => ({\r\n href: item.href,\r\n label: item.title,\r\n })),\r\n },\r\n {\r\n name: 'Components',\r\n items: components.map((item) => ({\r\n href: item.href,\r\n label: item.title,\r\n })),\r\n },\r\n {\r\n name: 'Blocks',\r\n items: blocks.map((item) => ({\r\n href: item.href,\r\n label: item.title,\r\n })),\r\n },\r\n {\r\n name: 'Learning',\r\n items: learning.map((item) => ({\r\n href: item.href,\r\n label: item.title,\r\n })),\r\n },\r\n {\r\n name: 'Support',\r\n items: support.map((item) => ({\r\n href: item.href,\r\n label: item.title,\r\n })),\r\n },\r\n ],\r\n desktop: [\r\n {\r\n href: '#',\r\n label: 'Products',\r\n gridCols: 3,\r\n categories: [\r\n {\r\n name: 'Starterkits',\r\n id: 'starterkits',\r\n items: starterkits,\r\n },\r\n {\r\n name: 'Components',\r\n id: 'components',\r\n items: components,\r\n },\r\n {\r\n name: 'Blocks',\r\n id: 'blocks',\r\n items: blocks,\r\n },\r\n ],\r\n },\r\n {\r\n href: '#',\r\n label: 'Resources',\r\n gridCols: 2,\r\n categories: [\r\n {\r\n name: 'Learning',\r\n id: 'learning',\r\n items: learning,\r\n },\r\n {\r\n name: 'Support',\r\n id: 'support',\r\n items: support,\r\n },\r\n ],\r\n },\r\n { href: '#', label: 'Pricing', active: false },\r\n { href: '#', label: 'Docs', active: false },\r\n ],\r\n}\r\n\r\nexport default function Navbar() {\r\n const Link = 'a' // if using Next.js remove this line. you can use the Link component from 'next/link'\r\n\r\n return (\r\n
\r\n
\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n {navigationLinks.desktop.map((link, index) => {\r\n if (link.categories && link.categories?.length > 0) {\r\n return (\r\n \r\n \r\n {link.label}\r\n \r\n 3 &&\r\n `columns-${link.gridCols} gap-4 lg:w-[600px]`\r\n )}\r\n >\r\n {link.categories.map((category) => (\r\n \r\n

\r\n {category.name}\r\n

\r\n
    \r\n {category.items.map(\r\n (item) => (\r\n \r\n {\r\n item.description\r\n }\r\n \r\n )\r\n )}\r\n
\r\n \r\n ))}\r\n \r\n
\r\n )\r\n }\r\n\r\n return (\r\n \r\n \r\n {link.label}\r\n \r\n \r\n )\r\n })}\r\n
\r\n
\r\n\r\n
\r\n \r\n Sign-in\r\n \r\n \r\n Get Started\r\n \r\n
\r\n
\r\n )\r\n}\r\n\r\nfunction ListItem({\r\n title,\r\n children,\r\n href,\r\n ...props\r\n}: React.ComponentPropsWithoutRef<'li'> & { href: string }) {\r\n const Link = 'a' // if using Next.js remove this line. you can use the Link component from 'next/link'\r\n\r\n return (\r\n
  • \r\n \r\n \r\n
    \r\n {title}\r\n
    \r\n

    \r\n {children}\r\n

    \r\n \r\n
    \r\n
  • \r\n )\r\n}\r\n", "type": "registry:component", "target": "components/navbar.tsx" }, { "path": "registry/default/blocks/navbar/mobile-nav.tsx", "content": "'use client'\r\n\r\nimport React from 'react'\r\nimport {\r\n Popover,\r\n PopoverContent,\r\n PopoverTrigger,\r\n} from '@/registry/default/ui/popover'\r\nimport { Button } from '@/registry/default/ui/button'\r\nimport { cn } from '@/lib/utils'\r\n// import Link from 'next/link'\r\n\r\ntype MobileNavProps = {\r\n nav: {\r\n name: string\r\n items: {\r\n label: string\r\n href: string\r\n }[]\r\n }[]\r\n}\r\n\r\nexport function MobileNav({ nav }: MobileNavProps) {\r\n const Link = 'a' // if using Next.js remove this line. you can use the Link component from 'next/link'\r\n\r\n const [open, setOpen] = React.useState(false)\r\n\r\n return (\r\n \r\n \r\n \r\n
    \r\n
    \r\n \r\n \r\n
    \r\n Toggle Menu\r\n
    \r\n \r\n
    \r\n \r\n
    \r\n {nav.map((category, index) => (\r\n
    \r\n

    \r\n {category.name}\r\n

    \r\n
    \r\n {category.items.map((item, index) => (\r\n setOpen(false)}\r\n >\r\n {item.label}\r\n \r\n ))}\r\n
    \r\n
    \r\n ))}\r\n
    \r\n \r\n
    \r\n )\r\n}\r\n", "type": "registry:component", "target": "components/mobile-nav.tsx" } ] }