components / 30

marked context menu

the hidden menu should still carry intent. focus, selection, nesting, and danger each leave a different hand-drawn trace.

shadcnnpx shadcn@latest add berkantay/cheez/marked-context-menu
live

actions appear where the hand is

waiting for a right click
x 248 / y 116
selected noteideas should feel handled.right click here
or press shift + f10
ink
character
controlled statecomfortableink canvas
<MarkedContextMenu tone="pink" character="rushed">
  <MarkedContextMenuTrigger>right click me</MarkedContextMenuTrigger>
  <MarkedContextMenuContent>
    <MarkedContextMenuItem shortcut="⌘D">duplicate</MarkedContextMenuItem>
    <MarkedContextMenuCheckboxItem checked={compact}>compact view</MarkedContextMenuCheckboxItem>
    <MarkedContextMenuSub>
      <MarkedContextMenuSubTrigger>appearance</MarkedContextMenuSubTrigger>
      <MarkedContextMenuContent side="right">…</MarkedContextMenuContent>
    </MarkedContextMenuSub>
    <MarkedContextMenuItem tone="danger">remove</MarkedContextMenuItem>
  </MarkedContextMenuContent>
</MarkedContextMenu>
grammar

one menu, four kinds of intent

the marks carry meaning
01 / actionunderline

focus follows the pointer or arrow keys.

02 / selectedcheck or circle

persistent choice survives after closing.

03 / nestedmoving arrow

direction previews another layer.

04 / dangerstrike through

destructive intent looks destructive.

reference

api

Base UI behavior, Cheez feedback
partproptypedefaultpurpose
RoottoneMarkedContextMenuTone"orange"frame ink
RootcharacterCheezCharacter"rushed"shared drawing pressure
RootframeMarkCheezType"rounded-box"popup boundary
RootitemMarkCheezType"short-underline"focused-item trace
RootselectedMarkCheezType"check"checked choice mark
TriggerchildrenReactNoderight-click target
ContentsideOffsetnumber6distance from pointer
ItemdescriptionReactNodesecondary action copy
ItemshortcutReactNodevisible keyboard hint
Itemtone"default" | "danger""default"destructive treatment
CheckboxItemcheckedbooleancontrolled multiple choice
RadioGroupvalueanycontrolled exclusive choice
Subopenbooleancontrolled nested menu

behavior notes

  • right click opens at the pointer; shift + f10 or the Menu key opens from the keyboard
  • arrow keys move focus, Enter chooses, Right opens a submenu, and Escape closes
  • placement flips and shifts when the menu approaches a viewport edge
  • checked and radio state stay controlled by your application
  • disabled items are skipped by pointer and keyboard navigation
  • focus management, dismissal, and collision handling come from Base UI
  • no Framer Motion is shipped