Context Menu
thegridcn/context-menuFreeComponent
thegridcn publishes no description for this item.
See it running
Open the demo on thegridcn
thegridcn.com/r/context-menuInstall it
npx shadcn@latest add https://thegridcn.com/r/context-menu.jsonSource
1"use client"23import * as React from "react"4import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"5import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"67import { cn } from "@/lib/utils"89function ContextMenu({10 ...props11}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {12 return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />13}1415function ContextMenuTrigger({16 ...props17}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {18 return (19 <ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />20 )21}2223function ContextMenuGroup({24 ...props25}: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {26 return (27 <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />28 )29}3031function ContextMenuPortal({32 ...props33}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {34 return (35 <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />36 )37}3839function ContextMenuSub({40 ...props41}: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {42 return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />43}4445function ContextMenuRadioGroup({46 ...props47}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {48 return (49 <ContextMenuPrimitive.RadioGroup50 data-slot="context-menu-radio-group"51 {...props}52 />53 )54}5556function ContextMenuSubTrigger({57 className,58 inset,59 children,60 ...props61}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {62 inset?: boolean63}) {64 return (65 <ContextMenuPrimitive.SubTrigger66 data-slot="context-menu-sub-trigger"67 data-inset={inset}68 className={cn(69 "focus:bg-muted focus:text-primary data-[state=open]:bg-muted data-[state=open]:text-primary [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",70 className71 )}72 {...props}73 >74 {children}75 <ChevronRightIcon className="ml-auto" />76 </ContextMenuPrimitive.SubTrigger>77 )78}7980function ContextMenuSubContent({81 className,82 ...props83}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {84 return (85 <ContextMenuPrimitive.SubContent86 data-slot="context-menu-sub-content"87 className={cn(88// … truncated
What it pulls in
npm packages
Files it writes
More from thegridcn
All 139 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | thegridcn | Components | Free | 2 deps | |
| Agent Avataragent-avatar | thegridcn | Components | Free | no deps | |
| Alertalert | thegridcn | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | thegridcn | Components | Free | 1 dep | |
| Announcement Barannouncement-bar | thegridcn | Components | Free | no deps | |
| Anomaly Banneranomaly-banner | thegridcn | Components | Free | no deps | |
| Arrival Panelarrival-panel | thegridcn | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | thegridcn | Components | Free | 1 dep |
