# contextMenuItemsCallback

Returns cell context-menu items. Replaces the entire default list rather than appending to it.

Canonical: https://grid.syidax.com/docs/options/contextMenuItemsCallback/

<a id="meaning"></a>

## What does this API do?

Returns cell context-menu items. Replaces the entire default list rather than appending to it.

API for Pro features: Built-in context menu

<a id="contract"></a>

## Exact input and result types

```typescript
contextMenuItemsCallback: (
    ctx: ContextMenuContext<GridRow>,
  ) => ContextMenuItem<GridRow>[]
```

| Item | Value |
| --- | --- |
| JavaScript name | contextMenuItemsCallback |
| HTML attribute | context-menu-items-callback |
| Default | undefined |
| Input type | (<br>    ctx: ContextMenuContext<GridRow>,<br>  ) => ContextMenuItem<GridRow>[] |

<a id="usage"></a>

## Usage flow

Set this on a property of the Grid element. Pass arrays, objects, and callbacks through JavaScript, and use new arrays or objects when applying changes.

<a id="types"></a>

## Read related types

- [ContextMenuContext](https://grid.syidax.com/docs/types/ContextMenuContext.md)
- [GridRow](https://grid.syidax.com/docs/types/GridRow.md)
- [ContextMenuItem](https://grid.syidax.com/docs/types/ContextMenuItem.md)

<a id="recipes"></a>

## Feature explanations and examples

- [Cell context menus](https://grid.syidax.com/docs/features/context-menu.md) — A cell's context menu offers actions such as Copy, Copy row, and Export for the current location. Also provide toolbar or keyboard access to frequently used features.
