Skip to content

cellContextMenuItem

cellContextMenuItem<TData, TArgs>(id, factory): CellContextMenuItemFactory<TData, TArgs>

Defined in: contextMenu.tsx:130

Helper function to create a cell context menu item with full context access.

The factory function receives context including the clicked cell, column, row, cell value, table instance, and plugin configuration args.

TData

TArgs = unknown

string

Unique identifier for the menu item

(ctx) => ContextMenuItemEntry

Factory function that receives context and returns menu item entry

CellContextMenuItemFactory<TData, TArgs>

cellContextMenuItem("filter-by-value", (ctx) => ({
label: `Filter by "${ctx.value}"`,
onClick: () => {
ctx.column.setFilterValue(ctx.value);
},
}))
cellContextMenuItem("copy-value", (ctx) => ({
label: "Copy value",
onClick: () => navigator.clipboard.writeText(String(ctx.value)),
visible: ctx.value != null,
}))