Context Menu
uiable/context-menuFreeComponent
Context Menu component.
Live preview
live · rendered by the registry
Rendered by uiable on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uiable.com/r/context-menu.jsonSource
1"use client";23import { ComponentProps } from "react";45import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";67import { cn } from "@/lib/utils";8import { ChevronRightIcon, CheckIcon } from "lucide-react";910function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) {11 return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />;12}1314function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props) {15 return (16 <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />17 );18}1920function ContextMenuTrigger({21 className,22 ...props23}: ContextMenuPrimitive.Trigger.Props) {24 return (25 <ContextMenuPrimitive.Trigger26 data-slot="context-menu-trigger"27 className={cn("select-none", className)}28 {...props}29 />30 );31}3233function ContextMenuContent({34 className,35 align = "start",36 alignOffset = 4,37 side = "right",38 sideOffset = 0,39 ...props40}: ContextMenuPrimitive.Popup.Props &41 Pick<42 ContextMenuPrimitive.Positioner.Props,43 "align" | "alignOffset" | "side" | "sideOffset"44 >) {45 return (46 <ContextMenuPrimitive.Portal>47 <ContextMenuPrimitive.Positioner48 className="isolate z-50 outline-none"49 align={align}50 alignOffset={alignOffset}51 side={side}52 sideOffset={sideOffset}53 >54 <ContextMenuPrimitive.Popup55 data-slot="context-menu-content"56 className={cn(57 "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 max-h-(--available-height) min-w-40 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-3 shadow-lg ring-1 duration-100 outline-none",58 className59 )}60 {...props}61 />62 </ContextMenuPrimitive.Positioner>63 </ContextMenuPrimitive.Portal>64 );65}6667function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props) {68 return (69 <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />70 );71}7273function ContextMenuLabel({74 className,75// … truncated
What it pulls in
npm packages
Files it writes
More from uiable
All 712 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | uiable | Components | Free | 2 deps | |
| Alertalert | uiable | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | uiable | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | uiable | Components | Free | no deps | |
| Attachmentattachment | uiable | Components | Free | 2 deps | |
| Avataravatar | uiable | Components | Free | 1 dep | |
| Badgebadge | uiable | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | uiable | Components | Free | 2 deps |
