context-menu
yyc3-knowledge-base/context-menuUnverifiedComponent
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/YYC-Cube/YYC3-Knowledge-Base/main/YYC3-D/ui/apps/v4/context-menu.jsonSource
1"use client"23import * as React from "react"4import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"5import { Check, ChevronRight, Circle } from "lucide-react"67import { cn } from "@/lib/utils"89const ContextMenu = ContextMenuPrimitive.Root1011const ContextMenuTrigger = ContextMenuPrimitive.Trigger1213const ContextMenuGroup = ContextMenuPrimitive.Group1415const ContextMenuPortal = ContextMenuPrimitive.Portal1617const ContextMenuSub = ContextMenuPrimitive.Sub1819const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup2021const ContextMenuSubTrigger = React.forwardRef<22 React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,23 React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {24 inset?: boolean25 }26>(({ className, inset, children, ...props }, ref) => (27 <ContextMenuPrimitive.SubTrigger28 ref={ref}29 className={cn(30 "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",31 inset && "pl-8",32 className33 )}34 {...props}35 >36 {children}37 <ChevronRight className="ml-auto h-4 w-4" />38 </ContextMenuPrimitive.SubTrigger>39))40ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName4142const ContextMenuSubContent = React.forwardRef<43 React.ElementRef<typeof ContextMenuPrimitive.SubContent>,44 React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>45>(({ className, ...props }, ref) => (46 <ContextMenuPrimitive.SubContent47 ref={ref}48 className={cn(49 "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 origin-[--radix-context-menu-content-transform-origin]",50 className51 )}52 {...props}53 />54))55ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName5657const ContextMenuContent = React.forwardRef<58 React.ElementRef<typeof ContextMenuPrimitive.Content>,59 React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>60>(({ className, ...props }, ref) => (61 <ContextMenuPrimitive.Portal>62// … truncated
What it pulls in
npm packages
Files it writes
More from shadcn/ui
All 411 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Unverified | 1 dep | |
| alertalert | shadcn/ui | Components | Unverified | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Unverified | 1 dep | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Unverified | 1 dep | |
| avataravatar | shadcn/ui | Components | Unverified | 1 dep | |
| badgebadge | shadcn/ui | Components | Unverified | 1 dep | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Unverified | 1 dep | |
| buttonbutton | shadcn/ui | Components | Unverified | 1 dep |
