8-bit Context Menu
8bitcn/context-menuFreeComponent
A simple 8-bit context menu component
Install it
npx shadcn@latest add https://www.8bitcn.com/r/context-menu.jsonSource
1"use client";23import * as React from "react";45import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";6import { ChevronRight, Circle } from "lucide-react";78import { cn } from "@/lib/utils";910import "@/components/ui/8bit/styles/retro.css";1112const ContextMenu = ContextMenuPrimitive.Root;1314const ContextMenuTrigger = ContextMenuPrimitive.Trigger;1516const ContextMenuGroup = ContextMenuPrimitive.Group;1718const ContextMenuPortal = ContextMenuPrimitive.Portal;1920const ContextMenuSub = ContextMenuPrimitive.Sub;2122const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;2324const ContextMenuSubTrigger = React.forwardRef<25 React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,26 React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {27 inset?: boolean;28 }29>(({ className, inset, children, ...props }, ref) => (30 <ContextMenuPrimitive.SubTrigger31 ref={ref}32 className={cn(33 "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:border-y-4 focus:border-foreground h-8 focus:dark:border-ring border-dashed focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",34 inset && "pl-8",35 className36 )}37 {...props}38 >39 {children}40 <ChevronRight className="ml-auto size-4" />41 </ContextMenuPrimitive.SubTrigger>42));43ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;4445const ContextMenuSubContent = React.forwardRef<46 React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,47 React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>48>(({ className, ...props }, ref) => (49 <ContextMenuPrimitive.SubContent50 ref={ref}51 className={cn(52 "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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]",53 className54 )}55 {...props}56 />57));58ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;5960const ContextMenuContent = React.forwardRef<61 React.ComponentRef<typeof ContextMenuPrimitive.Content>,62// … truncated
Files it writes
More from 8bitcn
All 121 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| 8-bit Accordionaccordion | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Alertalert | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Alert Dialogalert-dialog | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Avataravatar | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Badgebadge | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Breadcrumbbreadcrumb | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Buttonbutton | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Button Groupbutton-group | 8bitcn | Components | Free | no deps · 4 files |
