# ContextMenuItem

Fields, allowed values, and APIs that use ContextMenuItem.

Canonical: https://grid.syidax.com/docs/types/ContextMenuItem/

<a id="definition"></a>

## Type definition

A question mark (?) marks an optional field; readonly marks a value you should not change directly. A union (|) accepts one of the listed forms. Functions are callbacks that Grid invokes at the relevant point.

```typescript
export interface ContextMenuItem<TRow = Record<string, unknown>> {
  id: ContextMenuActionId;
  label: string;
  disabled?: boolean;
  separator?: boolean;
  action?: (ctx: ContextMenuContext<TRow>) => void;
  icon?: string;
}
```

<a id="used-by"></a>

## APIs using this type

- [contextMenuItemsCallback](https://grid.syidax.com/docs/options/contextMenuItemsCallback.md) — Returns cell context-menu items. Replaces the entire default list rather than appending to it.
- [getContextMenuItems](https://grid.syidax.com/docs/methods/getContextMenuItems.md) — Calculates context-menu items for a displayed row and field.

<a id="parents"></a>

## Contracts containing this type

- [SyGridImperativeMethods](https://grid.syidax.com/docs/types/SyGridImperativeMethods.md)

<a id="related"></a>

## Related types

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