"use client" import * as React from "react" import { Pressable, type Selection } from "react-aria-components" import { Example, ExampleWrapper, } from "@/registry/bases/aria/components/example" import { Button } from "@/registry/bases/aria/ui/button" import { ContextMenu, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, } from "@/registry/bases/aria/ui/context-menu" import { Dialog, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from "@/registry/bases/aria/ui/dialog" import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder" export default function ContextMenuExample() { return ( ) } function ContextMenuBasic() { return (
Right click here
Back Forward Reload
) } function ContextMenuWithIcons() { return (
Right click here
Copy Cut Paste Delete
) } function ContextMenuWithShortcuts() { return (
Right click here
Back ⌘[ Forward ⌘] Reload ⌘R Save ⌘S Save As... ⇧⌘S
) } function ContextMenuWithSubmenu() { return (
Right click here
Copy ⌘C Cut ⌘X More Tools Save Page... Create Shortcut... Name Window... Developer Tools Delete
) } function ContextMenuWithGroups() { return (
Right click here
File New File ⌘N Open File ⌘O Save ⌘S Edit Undo ⌘Z Redo ⇧⌘Z Cut ⌘X Copy ⌘C Paste ⌘V Delete ⌫
) } function ContextMenuWithCheckboxes() { const [selectedKeys, setSelectedKeys] = React.useState( new Set(["bookmarks-bar", "developer-tools"]) ) return (
Right click here
Show Bookmarks Bar Show Full URLs Show Developer Tools
) } function ContextMenuWithRadio() { const [user, setUser] = React.useState("pedro") const [theme, setTheme] = React.useState("light") return (
Right click here
People setUser( keys === "all" ? "pedro" : (keys.values().next().value as string) ) } > Pedro Duarte Colm Tuite Theme setTheme( keys === "all" ? "light" : (keys.values().next().value as string) ) } > Light Dark System
) } function ContextMenuWithDestructive() { return (
Right click here
Edit Share Archive Delete
) } function ContextMenuWithSides() { return (
{( [ { label: "start", placement: "start top" }, { label: "left", placement: "left top" }, { label: "top", placement: "top start" }, { label: "bottom", placement: "bottom start" }, { label: "right", placement: "right top" }, { label: "end", placement: "end top" }, ] as const ).map(({ label, placement }) => (
{label}
Back Forward Reload
))}
) } function ContextMenuInDialog() { return ( Context Menu Example Right click on the area below to see the context menu.
Right click here
Copy Cut Paste More Options Save Page... Create Shortcut... Name Window... Developer Tools Delete
) } function ContextMenuWithInset() { const [selectedKeys, setSelectedKeys] = React.useState( new Set(["bookmarks"]) ) const [theme, setTheme] = React.useState("system") return (
Right click here
Actions Copy Cut Paste Appearance Bookmarks Full URLs setTheme( keys === "all" ? "system" : (keys.values().next().value as string) ) } > Theme Light Dark System More Options Save Page... Create Shortcut...
) }