Skip to content
Sheetwrite

Sheetwrite / Documentation

ContextMenuItem@sheetwrite/core

Built-in, separator, or custom callback row in the right-click menu.

Built-in, separator, or custom callback row in the right-click menu.

Members 7

id Stable host identifier, exposed as data-context-menu-item.
id?: string;
action Built-in action to bind (or "separator").
action?: ContextMenuActionName;

Built-in action to bind (or "separator"). Omit when supplying `onClick`.

onClick Custom click handler; receives the grid and the right-clicked cell (null if none).
onClick?: (grid: Grid, cell: CellAddress | null) => void;
label Menu row text. Defaults per action.
label?: string;
shortcut Optional shortcut hint rendered beside the label.
shortcut?: string;
visible Static or request-aware visibility.
visible?: boolean | ((context: ContextMenuContext) => boolean);

Static or request-aware visibility. Hidden separators are normalized.

disabled Static or context-aware disabled state.
disabled?: boolean | ((context: ContextMenuContext) => boolean);

Declaration

View full TypeScript declaration
export interface ContextMenuItem {
id?: string;
action?: ContextMenuActionName;
onClick?: (grid: Grid, cell: CellAddress | null) => void;
label?: string;
shortcut?: string;
visible?: boolean | ((context: ContextMenuContext) => boolean);
disabled?: boolean | ((context: ContextMenuContext) => boolean);
}