Glass Navigation Menu
washiveil/glass-navigation-menuFreeComponent
Site navigation with strong-glass flyout panels, built on Radix NavigationMenu.
Install it
npx shadcn@latest add https://washiveil.alexchih.com/r/glass-navigation-menu.jsonSource
1'use client'23import * as React from 'react'4import { NavigationMenu as NavigationMenuPrimitive } from 'radix-ui'5import { cva } from 'class-variance-authority'6import { ChevronDown } from 'lucide-react'78import { cn } from '@/lib/utils'910const GlassNavigationMenu = React.forwardRef<11 React.ComponentRef<typeof NavigationMenuPrimitive.Root>,12 React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>13>(({ className, children, ...props }, ref) => (14 <NavigationMenuPrimitive.Root15 ref={ref}16 className={cn('relative z-10 flex max-w-max flex-1 items-center justify-center', className)}17 {...props}18 >19 {children}20 <GlassNavigationMenuViewport />21 </NavigationMenuPrimitive.Root>22))23GlassNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName2425const GlassNavigationMenuList = React.forwardRef<26 React.ComponentRef<typeof NavigationMenuPrimitive.List>,27 React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>28>(({ className, ...props }, ref) => (29 <NavigationMenuPrimitive.List30 ref={ref}31 className={cn(32 'group flex flex-1 list-none items-center justify-center gap-1 rounded-full border border-muted bg-muted p-1 backdrop-blur',33 className,34 )}35 {...props}36 />37))38GlassNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName3940const GlassNavigationMenuItem = NavigationMenuPrimitive.Item4142const navigationMenuTriggerStyle = cva(43 'group inline-flex items-center justify-center rounded-full px-3.5 py-1.5 text-sm font-medium text-muted-foreground dark:text-body transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground data-[active]:bg-accent data-[active]:text-accent-foreground',44)4546const GlassNavigationMenuTrigger = React.forwardRef<47 React.ComponentRef<typeof NavigationMenuPrimitive.Trigger>,48 React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>49>(({ className, children, ...props }, ref) => (50 <NavigationMenuPrimitive.Trigger51 ref={ref}52 className={cn(navigationMenuTriggerStyle(), 'group', className)}53 {...props}54 >55 {children}{' '}56 <ChevronDown57 className="relative top-[1px] ml-1 size-3 transition duration-200 group-data-[state=open]:rotate-180"58 aria-hidden="true"59 />60// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from washiveil
All 58 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Ambient Fieldambient-field | washiveil | Components | Free | no deps | |
| Chipchip | washiveil | Components | Free | 1 dep | |
| Code Badgecode-badge | washiveil | Components | Free | no deps | |
| Glass Accordionglass-accordion | washiveil | Components | Free | 2 deps | |
| Glass Alertglass-alert | washiveil | Components | Free | 1 dep | |
| Glass Alert Dialogglass-alert-dialog | washiveil | Components | Free | 1 dep | |
| Glass Aspect Ratioglass-aspect-ratio | washiveil | Components | Free | 1 dep | |
| Glass Avatarglass-avatar | washiveil | Components | Free | 1 dep |
