{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "context-menu-shadcnui", "type": "registry:component", "title": "Context Menu", "description": "Right-click context menu with nested items animation", "registryDependencies": [ "button" ], "dependencies": [ "framer-motion", "lucide-react", "react" ], "files": [ { "path": "@uitripled/react-shadcn/src/components/navigation/context-menu.tsx", "content": "\"use client\";\n\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { Copy, Edit, Share, Trash } from \"lucide-react\";\nimport { useState } from \"react\";\n\nconst menuItems = [\n { icon: Copy, label: \"Copy\", shortcut: \"⌘C\" },\n { icon: Edit, label: \"Edit\", shortcut: \"⌘E\" },\n { icon: Share, label: \"Share\", shortcut: \"⌘S\" },\n { icon: Trash, label: \"Delete\", shortcut: \"⌘D\", danger: true },\n];\n\nexport function ContextMenu() {\n const [position, setPosition] = useState({ x: 0, y: 0 });\n const [isVisible, setIsVisible] = useState(false);\n\n const handleContextMenu = (e: React.MouseEvent) => {\n e.preventDefault();\n setPosition({ x: e.clientX, y: e.clientY });\n setIsVisible(true);\n };\n\n return (\n <>\n setIsVisible(false)}\n className=\"flex h-64 w-64 items-center justify-center rounded-2xl border-2 border-dashed bg-[var(--card-bg)]\"\n >\n

Right-click here

\n \n\n \n {isVisible && (\n <>\n setIsVisible(false)}\n />\n \n {menuItems.map((item, index) => {\n const Icon = item.icon;\n return (\n setIsVisible(false)}\n >\n
\n \n {item.label}\n
\n {item.shortcut}\n \n );\n })}\n \n \n )}\n
\n \n );\n}\n", "type": "registry:component", "target": "components/uitripled/context-menu-shadcnui.tsx" } ] }