ContextMenuTrigger is a plain div with no look of its own. Nothing shows that the menu is there, so make every action reachable another way.
file-row-menu.tsx
ContextMenu
| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From Base UIContextMenu.RootBase UI docs | |||||||||||||||||||||||||||||||||||||||||||||
| on | — | Event handler called when the menu is opened or closed. | |||||||||||||||||||||||||||||||||||||||||||
| close | boolean | — | Deprecated: This prop has no effect on Context Menu. | ||||||||||||||||||||||||||||||||||||||||||
| children | ReactNode | — | |||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||
ContextMenuTrigger
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ContextMenuPortal
<div>| Prop | Type | Default | Description |
|---|---|---|---|
From Base UIMenu.PortalBase UI docs | |||
| keep | boolean | false | Whether to keep the portal mounted in the DOM while the popup is hidden. |
| container | — | A parent element to render the portal element into. | |
| class | — | CSS class applied to the element, or a function that returns a class based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ContextMenuContent
<div>| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | boolean | false | Show an arrow that points at the trigger. The gap grows from 4px to 8px. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | boolean | false | Put a clear layer under the popup (Base UI Menu.Backdrop), for example to dim it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| portal | — | Other Base UI props of the inner parts. A className here adds to the component classes. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| positioner | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | PopupPartProps<MenuBackdropProps> | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | PopupPartProps<MenuArrowProps> | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UIMenu.PopupBase UI docs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| children | ReactNode | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id | string | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| final | — | Determines the element to focus when the menu is closed. - false: Do not move focus. - true: Move focus based on the default behavior (trigger or previously focused element). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, or false/undefined to do nothing. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Arrow DownorArrow Up | Moves to the next or the previous item. |
|---|---|
| HomeorEnd | Moves to the first or the last item. |
| EnterorSpace | Runs the item, or changes a check or a radio choice. |
| Letter keys | Moves to the item whose text starts with the typed letters. |
| Arrow Right | Opens a submenu. In right to left, use Arrow Left. |
| Arrow Left | Closes a submenu. In right to left, use Arrow Right. |
| Escape | Closes the menu. |
- MenuPick Menu for actions from a button: a Context Menu must never be the only way to reach an action.
- PopoverA panel that opens from a button and stays until people close it. It holds content they can use, such as a share link, filters, or a short form.
- TreeLets people browse and pick items in a hierarchy, such as files, docs pages, or categories. Arrow keys open and close rows, and rows can move by drag.
Built with
Installs with Context Menu
- Components
- Menu





