ContextMenu

A right-click menu family for compact action, selection, and nested action surfaces.

Preview#

Preview defaults the menu open so the row styling, density, and theme differences are visible immediately; dismiss it and right-click the trigger to reopen it.

Right click thread
import {
  ContextMenu,
  ContextMenuContent,
  ContextMenuItem,
  ContextMenuLabel,
  ContextMenuSeparator,
  ContextMenuShortcut,
  ContextMenuTrigger,
} from "raft-ui";

<ContextMenu>
  <ContextMenuTrigger />
  <ContextMenuContent>
    <ContextMenuLabel />
    <ContextMenuItem>
      <ContextMenuShortcut />
    </ContextMenuItem>
    <ContextMenuSeparator />
  </ContextMenuContent>
</ContextMenu>

Radio group#

Right click notification

Checkboxes#

Right click list

API#WIP

PropTypeDefaultDescription
...propsBase UI ContextMenu.Root.PropsOwns right-click open state, focus roving, keyboard navigation, and dismissal.
PropTypeDefaultDescription
...propsBase UI ContextMenu.Trigger.PropsRight-click or long-press target. Renders a div and keeps text selection off.
PropTypeDefaultDescription
containerHTMLElement | RefObject | nullCustom portal container for framed previews or contained overlays.
...propsBase UI ContextMenu.Portal.PropsPortals the menu to the body or a custom container.
PropTypeDefaultDescription
...propsBase UI Popup + Positioner propsPortaled floating menu shell. Keeps the menu near the context point while shifting it inside the collision boundary with 8px of padding.
PropTypeDefaultDescription
...propsComponentPropsWithRef<"div">Static panel shell for docs previews and non-portaled comparison panes.
PropTypeDefaultDescription
...propsBase UI ContextMenu.Item.PropsAction row. Compose leading icons, label text, and trailing shortcuts as children.
PropTypeDefaultDescription
...propsStyledProps<ComponentPropsWithRef<"span">>Small muted label above grouped items or inside an item.
PropTypeDefaultDescription
...propsdiv propsSection label for grouped rows.
PropTypeDefaultDescription
...propsKbd propsRight-aligned keyboard hint composed inside a menu row.
PropTypeDefaultDescription
...propsBase UI ContextMenu.Separator.PropsGroup separator mapped from the source ContextMenuDivider primitive.
PropTypeDefaultDescription
...propsBase UI ContextMenu.RadioGroup.PropsSingle-selection group inside the menu.
PropTypeDefaultDescription
...propsBase UI ContextMenu.RadioItem.PropsSelectable row with a trailing check indicator.
PropTypeDefaultDescription
...propsBase UI ContextMenu.RadioItemIndicator.PropsRadio dot shown inside a selected ContextMenuRadioItem.
PropTypeDefaultDescription
...propsBase UI ContextMenu.CheckboxItem.PropsToggleable row with a trailing check indicator.
PropTypeDefaultDescription
...propsBase UI ContextMenu.CheckboxItemIndicator.PropsCheck indicator shown inside a checked ContextMenuCheckboxItem.
PropTypeDefaultDescription
...propsBase UI ContextMenu.SubmenuRoot.PropsNested context-menu branch for secondary action groups.
PropTypeDefaultDescription
...propsBase UI ContextMenu.SubmenuTrigger.PropsRow that opens a nested menu. Compose the chevron as the trailing icon.