# Context Menu

> A menu of contextual actions that opens on right-click or long press.

```tsx title="hero.tsx"
import {
  ContextMenu,
  ContextMenuContent,
  ContextMenuItem,
  ContextMenuSeparator,
  ContextMenuTrigger,
} from '@langgenius/dify-ui/context-menu'
import { IconButton } from '@langgenius/dify-ui/icon-button'
import { Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger } from '@langgenius/dify-ui/menu'
import { StatusDot } from '@langgenius/dify-ui/status-dot'

const documents = [
  {
    name: 'Pricing FAQ.pdf',
    chunks: '24 chunks',
    status: 'success',
    statusLabel: 'Indexed',
    icon: 'i-ri-file-pdf-2-line',
  },
  {
    name: 'Refund policy.md',
    chunks: '18 chunks',
    status: 'success',
    statusLabel: 'Indexed',
    icon: 'i-ri-markdown-line',
  },
  {
    name: 'Onboarding guide.docx',
    chunks: '32 chunks',
    status: 'warning',
    statusLabel: 'Paused',
    icon: 'i-ri-file-word-2-line',
  },
] as const

const actions = [
  { label: 'Rename', icon: 'i-ri-edit-line' },
  { label: 'Download', icon: 'i-ri-download-2-line' },
  { label: 'Disable', icon: 'i-ri-forbid-line' },
] as const

export function ContextMenuHeroDemo() {
  return (
    <div className="flex w-full max-w-sm flex-col gap-2">
      <p className="px-3 system-xs-regular text-text-tertiary">
        Right-click a row or open its menu
      </p>
      <ul className="flex flex-col divide-y divide-divider-subtle">
        {documents.map((document) => (
          <li
            key={document.name}
            className="relative has-[button[data-popup-open]]:bg-state-base-active"
          >
            <ContextMenu>
              <ContextMenuTrigger className="flex w-full items-center gap-3 py-2.5 ps-3 pe-11 transition-colors select-none hover:bg-state-base-hover active:bg-state-base-active data-popup-open:bg-state-base-active">
                <span className="flex size-8 shrink-0 items-center justify-center rounded-lg bg-background-section text-text-tertiary">
                  <span aria-hidden="true" className={`${document.icon} size-4`} />
                </span>
                <div className="min-w-0 grow">
                  <p className="truncate system-sm-medium text-text-primary">{document.name}</p>
                  <div className="flex items-center gap-2 system-xs-regular text-text-tertiary">
                    <span className="inline-flex shrink-0 items-center gap-1.5">
                      <StatusDot status={document.status} size="small" />
                      {document.statusLabel}
                    </span>
                    <span aria-hidden="true">·</span>
                    <span className="truncate tabular-nums">{document.chunks}</span>
                  </div>
                </div>
              </ContextMenuTrigger>
              <ContextMenuContent className="w-40">
                {actions.map((action) => (
                  <ContextMenuItem key={action.label}>
                    <span
                      aria-hidden="true"
                      className={`${action.icon} size-4 shrink-0 text-text-tertiary`}
                    />
                    {action.label}
                  </ContextMenuItem>
                ))}
                <ContextMenuSeparator />
                <ContextMenuItem variant="destructive">
                  <span aria-hidden="true" className="i-ri-delete-bin-line size-4 shrink-0" />
                  Delete
                </ContextMenuItem>
              </ContextMenuContent>
            </ContextMenu>
            <div className="absolute end-2 top-1/2 -translate-y-1/2">
              <Menu>
                <MenuTrigger
                  render={
                    <IconButton
                      aria-label={`More actions for ${document.name}`}
                      className="active:bg-state-base-active data-popup-open:bg-state-base-hover data-popup-open:text-text-secondary"
                    >
                      <span aria-hidden="true" className="i-ri-more-fill size-4" />
                    </IconButton>
                  }
                />
                <MenuContent align="end" className="w-40">
                  {actions.map((action) => (
                    <MenuItem key={action.label}>
                      <span
                        aria-hidden="true"
                        className={`${action.icon} size-4 shrink-0 text-text-tertiary`}
                      />
                      {action.label}
                    </MenuItem>
                  ))}
                  <MenuSeparator />
                  <MenuItem variant="destructive">
                    <span aria-hidden="true" className="i-ri-delete-bin-line size-4 shrink-0" />
                    Delete
                  </MenuItem>
                </MenuContent>
              </Menu>
            </div>
          </li>
        ))}
      </ul>
    </div>
  )
}
```

## Usage guidelines

- Use `ContextMenu` as a shortcut to actions that are also reachable from a visible control, such as a `Menu` behind a "More actions" button. Touch, keyboard and assistive-technology users may not find or open a context menu.
- Wrap the area that owns the actions in `ContextMenuTrigger`, such as a card, a list row or a canvas. The trigger is a plain `<div>` and not a focus stop: let its content describe it, and do not give it an `aria-label` or a `tabIndex`.
- Keep the `Menu` with the same actions outside `ContextMenu`, as a sibling. A `Menu` inside `ContextMenu` joins the context menu instead of opening on its own.
- Use `ContextMenuContent` for the popup at the pointer. Compose `ContextMenuPortal`, `ContextMenuPositioner` and `ContextMenuPopup` when the popup anchors to an element instead of the pointer, or when it renders into a custom container, such as a canvas in fullscreen.
- Items, groups, submenus and checkbox or radio items follow the same rules as in `Menu`. A dialog that an item opens stays a sibling of the `ContextMenu` and opens through its handle.

## Anatomy

```tsx
import {
  ContextMenu,
  ContextMenuCheckboxItem,
  ContextMenuCheckboxItemIndicator,
  ContextMenuContent,
  ContextMenuGroup,
  ContextMenuGroupLabel,
  ContextMenuItem,
  ContextMenuLinkItem,
  ContextMenuRadioGroup,
  ContextMenuRadioItem,
  ContextMenuRadioItemIndicator,
  ContextMenuSeparator,
  ContextMenuSubmenu,
  ContextMenuSubmenuTrigger,
  ContextMenuTrigger,
} from '@langgenius/dify-ui/context-menu'
```

```tsx
<ContextMenu>
  <ContextMenuTrigger />
  <ContextMenuContent>
    <ContextMenuItem />
    <ContextMenuLinkItem />
    <ContextMenuSeparator />
    <ContextMenuGroup>
      <ContextMenuGroupLabel />
      <ContextMenuRadioGroup>
        <ContextMenuRadioItem>
          <ContextMenuRadioItemIndicator />
        </ContextMenuRadioItem>
      </ContextMenuRadioGroup>
    </ContextMenuGroup>
    <ContextMenuCheckboxItem>
      <ContextMenuCheckboxItemIndicator />
    </ContextMenuCheckboxItem>
    <ContextMenuSubmenu>
      <ContextMenuSubmenuTrigger />
      <ContextMenuContent />
    </ContextMenuSubmenu>
  </ContextMenuContent>
</ContextMenu>
```

`ContextMenuContent` bundles the portal, positioner and styled popup. `ContextMenuPopup` is the bare popup for a surface that places and dresses itself; compose it with `ContextMenuPortal` and `ContextMenuPositioner`.

## Examples

### Submenus and settings

Right-click the canvas to add blocks from a submenu or toggle the minimap. The "Canvas actions" menu offers the same items, so both share the minimap state.

```tsx title="canvas.tsx"
import {
  ContextMenu,
  ContextMenuCheckboxItem,
  ContextMenuCheckboxItemIndicator,
  ContextMenuContent,
  ContextMenuItem,
  ContextMenuSeparator,
  ContextMenuSubmenu,
  ContextMenuSubmenuTrigger,
  ContextMenuTrigger,
} from '@langgenius/dify-ui/context-menu'
import { IconButton } from '@langgenius/dify-ui/icon-button'
import {
  Menu,
  MenuCheckboxItem,
  MenuCheckboxItemIndicator,
  MenuContent,
  MenuItem,
  MenuSeparator,
  MenuSubmenu,
  MenuSubmenuTrigger,
  MenuTrigger,
} from '@langgenius/dify-ui/menu'
import * as React from 'react'

const blocks = [
  { label: 'LLM', icon: 'i-ri-sparkling-line' },
  { label: 'Knowledge retrieval', icon: 'i-ri-book-open-line' },
  { label: 'Code', icon: 'i-ri-code-s-slash-line' },
  { label: 'HTTP request', icon: 'i-ri-global-line' },
]

export function ContextMenuCanvasDemo() {
  const [showMinimap, setShowMinimap] = React.useState(true)

  return (
    <div className="relative w-full max-w-120">
      <ContextMenu>
        <ContextMenuTrigger className="relative flex h-52 flex-col justify-between overflow-hidden rounded-xl border border-divider-subtle bg-background-body p-4 transition-colors select-none hover:border-divider-regular data-popup-open:border-divider-deep data-popup-open:bg-background-section">
          <div className="flex min-w-0 items-center gap-2 pe-10">
            <span className="truncate system-xs-medium text-text-tertiary">
              Support triage workflow
            </span>
          </div>
          <div aria-hidden="true" className="flex items-center justify-center gap-2">
            <div className="flex items-center gap-2 rounded-xl border border-components-card-border bg-components-card-bg px-3 py-2 shadow-xs">
              <span className="flex size-5 items-center justify-center rounded-md bg-util-colors-blue-light-blue-light-500 text-text-primary-on-surface">
                <span className="i-ri-home-5-line size-3" />
              </span>
              <span className="system-xs-semibold text-text-primary">Start</span>
            </div>
            <div className="h-px w-6 bg-divider-deep" />
            <div className="flex items-center gap-2 rounded-xl border border-components-card-border bg-components-card-bg px-3 py-2 shadow-xs">
              <span className="flex size-5 items-center justify-center rounded-md bg-util-colors-indigo-indigo-500 text-text-primary-on-surface">
                <span className="i-ri-sparkling-line size-3" />
              </span>
              <span className="system-xs-semibold text-text-primary">LLM</span>
            </div>
          </div>
          <div className="flex min-h-8 items-end justify-between gap-2">
            <span className="system-xs-regular text-text-tertiary">Right-click the canvas</span>
            {showMinimap && (
              <div
                aria-hidden="true"
                className="flex h-8 w-16 items-center justify-center gap-1 rounded-md border border-divider-subtle bg-components-panel-bg px-2 shadow-xs"
              >
                <span className="h-2.5 w-4 rounded-xs bg-divider-deep" />
                <span className="h-px w-1.5 bg-divider-regular" />
                <span className="h-2.5 w-4 rounded-xs bg-text-accent/40" />
              </div>
            )}
          </div>
        </ContextMenuTrigger>
        <ContextMenuContent className="w-48">
          <ContextMenuSubmenu>
            <ContextMenuSubmenuTrigger>Add block</ContextMenuSubmenuTrigger>
            <ContextMenuContent className="w-48">
              {blocks.map((block) => (
                <ContextMenuItem key={block.label}>
                  <span
                    aria-hidden="true"
                    className={`${block.icon} size-4 shrink-0 text-text-tertiary`}
                  />
                  {block.label}
                </ContextMenuItem>
              ))}
            </ContextMenuContent>
          </ContextMenuSubmenu>
          <ContextMenuItem>Add note</ContextMenuItem>
          <ContextMenuItem disabled>Paste here</ContextMenuItem>
          <ContextMenuSeparator />
          <ContextMenuCheckboxItem checked={showMinimap} onCheckedChange={setShowMinimap}>
            Show minimap
            <ContextMenuCheckboxItemIndicator />
          </ContextMenuCheckboxItem>
        </ContextMenuContent>
      </ContextMenu>
      <div className="absolute end-3 top-3 rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg p-0.5 shadow-xs">
        <Menu>
          <MenuTrigger
            render={
              <IconButton
                aria-label="Canvas actions"
                className="active:bg-state-base-active data-popup-open:bg-state-base-hover data-popup-open:text-text-secondary"
              >
                <span aria-hidden="true" className="i-ri-more-fill size-4" />
              </IconButton>
            }
          />
          <MenuContent align="end" className="w-48">
            <MenuSubmenu>
              <MenuSubmenuTrigger>Add block</MenuSubmenuTrigger>
              <MenuContent className="w-48">
                {blocks.map((block) => (
                  <MenuItem key={block.label}>
                    <span
                      aria-hidden="true"
                      className={`${block.icon} size-4 shrink-0 text-text-tertiary`}
                    />
                    {block.label}
                  </MenuItem>
                ))}
              </MenuContent>
            </MenuSubmenu>
            <MenuItem>Add note</MenuItem>
            <MenuItem disabled>Paste here</MenuItem>
            <MenuSeparator />
            <MenuCheckboxItem checked={showMinimap} onCheckedChange={setShowMinimap}>
              Show minimap
              <MenuCheckboxItemIndicator />
            </MenuCheckboxItem>
          </MenuContent>
        </Menu>
      </div>
    </div>
  )
}
```

### Anchoring to an element

`ContextMenuPositioner` takes an `anchor`, so the popup lines up with the workflow block instead of the pointer. `ContextMenuPortal` takes a `container` in the same way. The block's "More actions" menu offers the same actions.

```tsx title="anchored.tsx"
import {
  ContextMenu,
  ContextMenuItem,
  ContextMenuPopup,
  ContextMenuPortal,
  ContextMenuPositioner,
  ContextMenuSeparator,
  ContextMenuTrigger,
} from '@langgenius/dify-ui/context-menu'
import { IconButton } from '@langgenius/dify-ui/icon-button'
import { Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger } from '@langgenius/dify-ui/menu'
import * as React from 'react'

const actions = [
  { label: 'Run this block', icon: 'i-ri-play-line' },
  { label: 'Duplicate', icon: 'i-ri-file-copy-line' },
  { label: 'Change block', icon: 'i-ri-arrow-left-right-line' },
]

export function ContextMenuAnchoredDemo() {
  const blockRef = React.useRef<HTMLDivElement>(null)

  return (
    <div ref={blockRef} className="relative w-full max-w-68">
      <ContextMenu>
        <ContextMenuTrigger className="flex w-full flex-col gap-2.5 rounded-2xl border border-divider-subtle bg-background-body p-3 shadow-xs transition-colors select-none hover:border-divider-regular hover:bg-background-section active:bg-state-base-active data-popup-open:border-divider-deep data-popup-open:bg-background-section">
          <div className="flex min-w-0 items-center gap-2 pe-8">
            <span className="flex size-6 shrink-0 items-center justify-center rounded-md bg-util-colors-blue-light-blue-light-500 text-text-primary-on-surface">
              <span aria-hidden="true" className="i-ri-book-open-line size-3.5" />
            </span>
            <p className="truncate system-sm-semibold text-text-primary">Knowledge retrieval</p>
          </div>
          <div className="flex items-center justify-between gap-2 rounded-lg bg-components-panel-bg px-2.5 py-1.5 system-xs-regular">
            <span className="truncate text-text-secondary">Product docs</span>
            <span className="shrink-0 text-text-tertiary tabular-nums">Top 4</span>
          </div>
        </ContextMenuTrigger>
        <ContextMenuPortal>
          <ContextMenuPositioner anchor={blockRef} side="inline-end" align="start" sideOffset={8}>
            <ContextMenuPopup className="w-44 scroll-py-1 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur py-1 shadow-lg backdrop-blur-[5px]">
              {actions.map((action) => (
                <ContextMenuItem key={action.label}>
                  <span
                    aria-hidden="true"
                    className={`${action.icon} size-4 shrink-0 text-text-tertiary`}
                  />
                  {action.label}
                </ContextMenuItem>
              ))}
              <ContextMenuSeparator />
              <ContextMenuItem variant="destructive">
                <span aria-hidden="true" className="i-ri-delete-bin-line size-4 shrink-0" />
                Delete
              </ContextMenuItem>
            </ContextMenuPopup>
          </ContextMenuPositioner>
        </ContextMenuPortal>
      </ContextMenu>
      <div className="absolute end-2.5 top-2.5">
        <Menu>
          <MenuTrigger
            render={
              <IconButton
                aria-label="More actions for Knowledge retrieval"
                className="active:bg-state-base-active data-popup-open:bg-state-base-hover data-popup-open:text-text-secondary"
              >
                <span aria-hidden="true" className="i-ri-more-fill size-4" />
              </IconButton>
            }
          />
          <MenuContent align="end" className="w-44">
            {actions.map((action) => (
              <MenuItem key={action.label}>
                <span
                  aria-hidden="true"
                  className={`${action.icon} size-4 shrink-0 text-text-tertiary`}
                />
                {action.label}
              </MenuItem>
            ))}
            <MenuSeparator />
            <MenuItem variant="destructive">
              <span aria-hidden="true" className="i-ri-delete-bin-line size-4 shrink-0" />
              Delete
            </MenuItem>
          </MenuContent>
        </Menu>
      </div>
    </div>
  )
}
```

## Keyboard

The trigger area is not a focus stop, so keyboard users open the same actions from the visible `Menu`. These keys apply once the context menu is open.

| Key                    | Action                                                                                                  |
| ---------------------- | ------------------------------------------------------------------------------------------------------- |
| `ArrowDown`, `ArrowUp` | Focuses the first or last item after the menu opens, then moves focus between items.                    |
| `Home`, `End`          | Focuses the first or last item.                                                                         |
| Printable characters   | Focuses the next item whose label starts with the typed text.                                           |
| `Enter`, `Space`       | Activates the focused item and closes the menu. Checkbox and radio items toggle and keep the menu open. |
| `Enter`, `ArrowRight`  | Opens the submenu of a focused submenu trigger and focuses its first item.                              |
| `ArrowLeft`            | Closes the submenu and returns focus to its trigger.                                                    |
| `Escape`               | Closes the innermost open menu.                                                                         |

## API reference

### ContextMenu

Groups all parts of a context menu opened by right-clicking or long-pressing a trigger area. Doesn't render its own HTML element.

Inherits `onOpenChange`, `closeParentOnEsc`, `children`, `defaultOpen`, `loopFocus`, `highlightItemOnHover`, `onOpenChangeComplete`, `onItemHighlighted`, `open`, `orientation`, `disabled`, `actionsRef` from [Base UI ContextMenu.Root](https://base-ui.com/react/components/context-menu#root).

### ContextMenuCheckboxItem

A menu item that toggles a setting on or off. Renders a `<div>` element.

Inherits `className`, `render`, `style`, `checked`, `defaultChecked`, `onCheckedChange`, `disabled`, `label`, `id`, `closeOnClick`, `nativeButton` from [Base UI Menu.CheckboxItem](https://base-ui.com/react/components/menu#checkboxitem).

**Data attributes**

| Attribute          | Description                                         |
| ------------------ | --------------------------------------------------- |
| `data-checked`     | Present when the menu checkbox item is checked.     |
| `data-unchecked`   | Present when the menu checkbox item is not checked. |
| `data-disabled`    | Present when the menu checkbox item is disabled.    |
| `data-highlighted` | Present when the menu checkbox item is highlighted. |

### ContextMenuCheckboxItemIndicator

Indicates whether the checkbox item is ticked. Renders a `<span>` element.

Inherits `className`, `render`, `style`, `keepMounted` from [Base UI Menu.CheckboxItemIndicator](https://base-ui.com/react/components/menu#checkboxitemindicator).

**Data attributes**

| Attribute             | Description                                         |
| --------------------- | --------------------------------------------------- |
| `data-checked`        | Present when the menu checkbox item is checked.     |
| `data-unchecked`      | Present when the menu checkbox item is not checked. |
| `data-disabled`       | Present when the menu checkbox item is disabled.    |
| `data-starting-style` | Present when the indicator begins animating in.     |
| `data-ending-style`   | Present when the indicator is animating out.        |

### ContextMenuContent

A styled context menu popup bundled with a portal and positioner. Renders a `<div>` element.

**Props**

| Prop       | Type              | Default | Description                                |
| ---------- | ----------------- | ------- | ------------------------------------------ |
| `children` | `React.ReactNode` | —       | The menu items, rendered inside the popup. |

Inherits `className`, `render`, `style`, `id`, `finalFocus`, `side`, `sideOffset`, `align`, `alignOffset` from [Base UI Menu.Popup](https://base-ui.com/react/components/menu#popup).

**Data attributes**

| Attribute             | Description                                                          |
| --------------------- | -------------------------------------------------------------------- |
| `data-open`           | Present when the menu is open.                                       |
| `data-closed`         | Present when the menu is closed.                                     |
| `data-starting-style` | Present when the menu begins animating in.                           |
| `data-ending-style`   | Present when the menu is animating out.                              |
| `data-side`           | Indicates which side the popup is positioned relative to the anchor. |
| `data-align`          | Indicates how the popup is aligned relative to specified side.       |
| `data-instant`        | Present if animations should be instant.                             |

### ContextMenuGroup

Groups related menu items with the corresponding label. Renders a `<div>` element.

Inherits `children`, `className`, `render`, `style` from [Base UI Menu.Group](https://base-ui.com/react/components/menu#group).

### ContextMenuGroupLabel

An accessible label that is automatically associated with its parent group. Renders a `<div>` element.

Inherits `className`, `render`, `style` from [Base UI Menu.GroupLabel](https://base-ui.com/react/components/menu#grouplabel).

### ContextMenuItem

An individual interactive item in the menu. Renders a `<div>` element.

**Props**

| Prop       | Type                         | Default     | Description                                       |
| ---------- | ---------------------------- | ----------- | ------------------------------------------------- |
| `variant?` | `'default' \| 'destructive'` | `'default'` | Whether the item represents a destructive action. |

Inherits `disabled`, `label`, `id`, `closeOnClick`, `className`, `render`, `style`, `nativeButton` from [Base UI Menu.Item](https://base-ui.com/react/components/menu#item).

**Data attributes**

| Attribute          | Description                                  |
| ------------------ | -------------------------------------------- |
| `data-variant`     | The item variant, set by the `variant` prop. |
| `data-highlighted` | Present when the menu item is highlighted.   |
| `data-disabled`    | Present when the menu item is disabled.      |

### ContextMenuLinkItem

A link in the menu that can be used to navigate to a different page or section. Renders an `<a>` element.

**Props**

| Prop            | Type                         | Default     | Description                                         |
| --------------- | ---------------------------- | ----------- | --------------------------------------------------- |
| `variant?`      | `'default' \| 'destructive'` | `'default'` | Whether the item represents a destructive action.   |
| `closeOnClick?` | `boolean`                    | `true`      | Whether to close the menu when the item is clicked. |

Inherits `className`, `render`, `style`, `label`, `id` from [Base UI Menu.LinkItem](https://base-ui.com/react/components/menu#linkitem).

**Data attributes**

| Attribute          | Description                                  |
| ------------------ | -------------------------------------------- |
| `data-variant`     | The item variant, set by the `variant` prop. |
| `data-highlighted` | Present when the link is highlighted.        |

### ContextMenuPopup

A container for the menu items. Renders a `<div>` element.

Inherits `children`, `id`, `finalFocus`, `className`, `render`, `style` from [Base UI Menu.Popup](https://base-ui.com/react/components/menu#popup).

**Data attributes**

| Attribute             | Description                                                          |
| --------------------- | -------------------------------------------------------------------- |
| `data-open`           | Present when the menu is open.                                       |
| `data-closed`         | Present when the menu is closed.                                     |
| `data-starting-style` | Present when the menu begins animating in.                           |
| `data-ending-style`   | Present when the menu is animating out.                              |
| `data-side`           | Indicates which side the popup is positioned relative to the anchor. |
| `data-align`          | Indicates how the popup is aligned relative to specified side.       |
| `data-instant`        | Present if animations should be instant.                             |

### ContextMenuPortal

A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to `<body>`. Renders a `<div>` element.

Inherits `keepMounted`, `container`, `className`, `render`, `style` from [Base UI Menu.Portal](https://base-ui.com/react/components/menu#portal).

### ContextMenuPositioner

Positions the context menu popup against the pointer or a custom anchor. Renders a `<div>` element.

Inherits `className`, `render`, `style`, `anchor`, `positionMethod`, `side`, `sideOffset`, `align`, `alignOffset`, `arrowPadding`, `collisionBoundary`, `collisionPadding`, `sticky`, `disableAnchorTracking`, `collisionAvoidance` from [Base UI ContextMenu.Positioner](https://base-ui.com/react/components/context-menu#positioner).

**Data attributes**

| Attribute           | Description                                            |
| ------------------- | ------------------------------------------------------ |
| `data-open`         | Present when the menu is currently open.               |
| `data-side`         | The side of the anchor the component is placed on.     |
| `data-align`        | The alignment of the component relative to the anchor. |
| `data-anchorhidden` | Present when the anchor element is hidden.             |
| `data-nested`       | Present when the component is nested.                  |
| `data-instant`      | Whether CSS transitions should be disabled.            |

### ContextMenuRadioGroup

Groups related radio items. Renders a `<div>` element.

**Props**

| Prop             | Type                                                                              | Default | Description                                                                                                                                           |
| ---------------- | --------------------------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `defaultValue?`  | `Value`                                                                           | —       | The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the `value` prop instead.         |
| `onValueChange?` | `((value: Value, eventDetails: ContextMenuRadioGroupChangeEventDetails) => void)` | —       | Callback fired when the selected value changes.                                                                                                       |
| `value?`         | `Value`                                                                           | —       | The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the `defaultValue` prop instead. |

Inherits `className`, `render`, `style`, `children`, `disabled` from [Base UI Menu.RadioGroup](https://base-ui.com/react/components/menu#radiogroup).

**Data attributes**

| Attribute       | Description                        |
| --------------- | ---------------------------------- |
| `data-disabled` | Whether the component is disabled. |

### ContextMenuRadioItem

A menu item that works like a radio button in a given group. Renders a `<div>` element.

**Props**

| Prop    | Type    | Default | Description                                                              |
| ------- | ------- | ------- | ------------------------------------------------------------------------ |
| `value` | `Value` | —       | The value set on the surrounding radio group when this item is selected. |

Inherits `className`, `render`, `style`, `nativeButton`, `disabled`, `label`, `id`, `closeOnClick` from [Base UI Menu.RadioItem](https://base-ui.com/react/components/menu#radioitem).

**Data attributes**

| Attribute          | Description                                       |
| ------------------ | ------------------------------------------------- |
| `data-checked`     | Present when the menu radio item is selected.     |
| `data-unchecked`   | Present when the menu radio item is not selected. |
| `data-disabled`    | Present when the menu radio item is disabled.     |
| `data-highlighted` | Present when the menu radio item is highlighted.  |

### ContextMenuRadioItemIndicator

Indicates whether the radio item is selected. Renders a `<span>` element.

Inherits `className`, `render`, `style`, `keepMounted` from [Base UI Menu.RadioItemIndicator](https://base-ui.com/react/components/menu#radioitemindicator).

**Data attributes**

| Attribute             | Description                                           |
| --------------------- | ----------------------------------------------------- |
| `data-checked`        | Present when the menu radio item is selected.         |
| `data-unchecked`      | Present when the menu radio item is not selected.     |
| `data-disabled`       | Present when the menu radio item is disabled.         |
| `data-starting-style` | Present when the radio indicator begins animating in. |
| `data-ending-style`   | Present when the radio indicator is animating out.    |

### ContextMenuSeparator

A separator element accessible to screen readers. Renders a `<div>` element.

Inherits `orientation`, `className`, `render`, `style` from [Base UI Separator](https://base-ui.com/react/components/separator).

**Data attributes**

| Attribute          | Description                                 |
| ------------------ | ------------------------------------------- |
| `data-orientation` | Indicates the orientation of the separator. |

### ContextMenuSubmenu

Groups all parts of a submenu. Doesn't render its own HTML element.

Inherits `onOpenChange`, `closeParentOnEsc`, `children`, `defaultOpen`, `loopFocus`, `highlightItemOnHover`, `onOpenChangeComplete`, `onItemHighlighted`, `open`, `orientation`, `disabled`, `actionsRef` from [Base UI Menu.SubmenuRoot](https://base-ui.com/react/components/menu#submenuroot).

### ContextMenuSubmenuTrigger

A menu item that opens a submenu. Renders a `<div>` element.

**Props**

| Prop       | Type                         | Default     | Description                                       |
| ---------- | ---------------------------- | ----------- | ------------------------------------------------- |
| `variant?` | `'default' \| 'destructive'` | `'default'` | Whether the item represents a destructive action. |

Inherits `className`, `label`, `id`, `disabled`, `delay`, `closeDelay`, `openOnHover`, `render`, `style`, `nativeButton` from [Base UI Menu.SubmenuTrigger](https://base-ui.com/react/components/menu#submenutrigger).

**Data attributes**

| Attribute          | Description                                      |
| ------------------ | ------------------------------------------------ |
| `data-variant`     | The item variant, set by the `variant` prop.     |
| `data-popup-open`  | Present when the corresponding submenu is open.  |
| `data-highlighted` | Present when the submenu trigger is highlighted. |
| `data-disabled`    | Present when the submenu trigger is disabled.    |

### ContextMenuTrigger

An area that opens the menu on right click or long press. Renders a `<div>` element.

Inherits `className`, `render`, `style` from [Base UI ContextMenu.Trigger](https://base-ui.com/react/components/context-menu#trigger).

**Data attributes**

| Attribute         | Description                                          |
| ----------------- | ---------------------------------------------------- |
| `data-popup-open` | Present when the corresponding context menu is open. |
| `data-pressed`    | Present when the corresponding context menu is open. |
