navigation-menu
skeuomorph-krzysztof/navigation-menuFreeComponent
skeuomorph-krzysztof publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by skeuomorph-krzysztof on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://skeuomorph.krzysztof.studio/r/styles/new-york/navigation-menu.jsonSource
1import * as React from "react"2import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"3import { cva } from "class-variance-authority"4import { ChevronDown } from "lucide-react"56import { cn } from "@/lib/utils"78const NavigationMenu = React.forwardRef<9 React.ElementRef<typeof NavigationMenuPrimitive.Root>,10 React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>11>(({ className, children, ...props }, ref) => (12 <NavigationMenuPrimitive.Root13 ref={ref}14 className={cn(15 "relative z-10 flex max-w-max flex-1 items-center justify-center",16 className17 )}18 {...props}19 >20 {children}21 <NavigationMenuViewport />22 </NavigationMenuPrimitive.Root>23))24NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName2526const NavigationMenuList = React.forwardRef<27 React.ElementRef<typeof NavigationMenuPrimitive.List>,28 React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>29>(({ className, ...props }, ref) => (30 <NavigationMenuPrimitive.List31 ref={ref}32 className={cn(33 "group flex flex-1 list-none items-center justify-center space-x-1",34 className35 )}36 {...props}37 />38))39NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName4041const NavigationMenuItem = NavigationMenuPrimitive.Item4243const navigationMenuTriggerStyle = cva(44 "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"45)4647const NavigationMenuTrigger = React.forwardRef<48 React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,49 React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>50>(({ className, children, ...props }, ref) => (51 <NavigationMenuPrimitive.Trigger52 ref={ref}53 className={cn(navigationMenuTriggerStyle(), "group", className)}54 {...props}55 >56 {children}{" "}57 <ChevronDown58 className="relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"59 aria-hidden="true"60 />61 </NavigationMenuPrimitive.Trigger>62))63NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName6465const NavigationMenuContent = React.forwardRef<66// … truncated
What it pulls in
npm packages
Files it writes
More from skeuomorph-krzysztof
All 54 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | skeuomorph-krzysztof | Components | Free | 1 dep | |
| alertalert | skeuomorph-krzysztof | Components | Free | no deps | |
| alert-dialogalert-dialog | skeuomorph-krzysztof | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | skeuomorph-krzysztof | Components | Free | 1 dep | |
| avataravatar | skeuomorph-krzysztof | Components | Free | 1 dep | |
| badgebadge | skeuomorph-krzysztof | Components | Free | 1 dep | |
| breadcrumbbreadcrumb | skeuomorph-krzysztof | Components | Free | 1 dep | |
| buttonbutton | skeuomorph-krzysztof | Components | Free | 1 dep |
