Glass Dropdown Menu
washiveil/glass-dropdown-menuFreeComponent
Menu on strong glass — items, labels, separators, shortcuts, submenus. Built on Radix DropdownMenu.
Install it
npx shadcn@latest add https://washiveil.alexchih.com/r/glass-dropdown-menu.jsonSource
1'use client'23import * as React from 'react'4import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui'5import { Check, ChevronRight, Circle } from 'lucide-react'67import { cn } from '@/lib/utils'89const GlassDropdownMenu = DropdownMenuPrimitive.Root1011const GlassDropdownMenuTrigger = DropdownMenuPrimitive.Trigger1213const GlassDropdownMenuGroup = DropdownMenuPrimitive.Group1415const GlassDropdownMenuPortal = DropdownMenuPrimitive.Portal1617const GlassDropdownMenuSub = DropdownMenuPrimitive.Sub1819const GlassDropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup2021const GlassDropdownMenuSubTrigger = React.forwardRef<22 React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,23 React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {24 inset?: boolean25 }26>(({ className, inset, children, ...props }, ref) => (27 <DropdownMenuPrimitive.SubTrigger28 ref={ref}29 className={cn(30 'flex cursor-default select-none items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground focus:ring-2 focus:ring-inset focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',31 inset && 'pl-8',32 className,33 )}34 {...props}35 >36 {children}37 <ChevronRight className="ml-auto" />38 </DropdownMenuPrimitive.SubTrigger>39))40GlassDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName4142const GlassDropdownMenuSubContent = React.forwardRef<43 React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,44 React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>45>(({ className, ...props }, ref) => (46 <DropdownMenuPrimitive.Portal>47 <DropdownMenuPrimitive.SubContent48 ref={ref}49 className={cn(50 'z-50 min-w-[8rem] overflow-hidden rounded-2xl border border-glass-edge bg-glass-stronger p-1.5 backdrop-blur-2xl backdrop-saturate-150 shadow-[0_16px_48px_rgba(28,25,20,0.12)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',51 className,52 )}53 {...props}54 />55 </DropdownMenuPrimitive.Portal>56))57// … 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 |
