npm / @radix-ui/react-context-menu
@radix-ui/react-context-menu
What changed in @radix-ui/react-context-menu 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-21.
4 new APIs and options1 performance1 tooling8 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@radix-ui/react-context-menu 214 changes
New APIs and options 4
The align prop can now be overridden on ContextMenu.Content.
The side prop can now be overridden on ContextMenu.Content.
The sideOffset prop can now be overridden on ContextMenu.Content.
ContextMenu.Root now supports a controlled open prop for reading the open state and closing the menu programmatically; programmatic opening is discouraged because positioning depends on user interaction.
Performance 1
Unused components can now be dropped by bundlers; component parts use pure annotations and named render functions to enable dead-code elimination.
Tooling 1
The package is republished through CI with a provenance attestation, which may inform package verification decisions.
Fixes and other changes 8
Fixed a type regression so callback props accept handlers whose parameter is narrower than the prop's.
Optional types now allow explicit undefined for compatibility with TypeScript's exactOptionalPropertyTypes flag.
Reverted breaking changes that caused compatibility issues with React Server Components.
Conditional exports now let production builds drop development-only warnings.
Re-triggering an already-open ContextMenu now re-anchors it to the latest pointer position.
Menu items, tab triggers, toolbar links, and select items no longer intercept Space or Enter when those keys originate from focusable descendants.
Fixed menus and submenus remaining open after a window loses focus.
Fixed submenus staying expanded after reopening the context menu on long-press touch events.