Overlays
Context Menu
Presents contextual actions and choices anchored to pointer coordinates or long press.
Usage
Anatomy
The parts and how they nest, taken from the preview above.
Examples
File workspace actions
With link
Native anchors and router composition.
Nested menu
Two submenu levels with centered and start alignment.
With checkbox
Controlled and uncontrolled selection with a disabled option.
With group label
Group related contextual actions.
With radio group
Choose one file sort order.
Close on click
Choose whether an action dismisses the menu.
Open a dialog
Transfer focus to a dialog and return to the file target.
With switch
Checkbox behavior with decorative switch indicators.
Scrollable content
Render composition in a long, scrollable menu.
Recommendations
| Guidance | Practice |
|---|---|
| Do | Offer actions specific to the resource under the pointer. Match labels to the same actions elsewhere. |
Usage boundaries
| Guidance | Boundary |
|---|---|
| Scope | Provide a visible alternative for essential actions. Context menus must not be the only way to complete a task. |
API reference
Public props from @mizen-labs/ui. Use exported prop types for the complete TypeScript contract.
| Prop | Type | Default | Description |
|---|---|---|---|
| | — | Native Base UI root for open state and callbacks. |
| | — | Native Base UI portal. |
| | — | Right-click, keyboard, and long-press target; supports render. |
| | — | Popup with render, anchor, and portalProps; align=center and sideOffset=4. |
| | — | Groups related contextual actions. |
| | — | Action row with inset, destructive variant, disabled, and closeOnClick. |
| | — | Native anchor or router render target; closeOnClick defaults to true. |
| | — | Native checkbox item with controlled state and switch variant. |
| | — | Native radio selection group. |
| | — | Native radio option with a required value. |
| | — | Muted group heading with optional inset. |
| | — | Divider between groups. |
| | — | Native kbd element for shortcut text or Mizen keycaps. |
| | — | Native submenu root. |
| | — | Opens a submenu; preserves highlighting and cap-aligned labels. |
| | — | Submenu popup; align=start, sideOffset=0, alignOffset=-5 unless centered. |
| | — | Base UI Context Menu namespace. |