@sheetwrite/coreinterface
Built-in, separator, or custom callback row in the right-click menu.
- Package
@sheetwrite/core- Source
packages/core/src/types/grid.ts#L183
Members 7
id Stable host identifier, exposed as data-context-menu-item.
id?: string;action Built-in action to bind (or "separator").
action?: ContextMenuActionNametype ContextMenuActionName =
| "cut"
| "copy"
| "paste"
| "clearContents"
| "merge"
| "unmerge"
| "insertRowAbove"
| "insertRowBelow"
| "deleteRow"
| "insertColumnLeft"
| "insertColumnRight"
| "deleteColumn"
| "hideRow"
| "showAllRows"
// … 8 more lines — see the API reference
}type ContextMenuActionName =
| "cut"
| "copy"
| "paste"
| "clearContents"
| "merge"
| "unmerge"
| "insertRowAbove"
| "insertRowBelow"
| "deleteRow"
| "insertColumnLeft"
| "insertColumnRight"
| "deleteColumn"
| "hideRow"
| "showAllRows"
// … 8 more lines — see the API reference
}type ContextMenuActionName =
| "cut"
| "copy"
| "paste"
| "clearContents"
| "merge"
| "unmerge"
| "insertRowAbove"
| "insertRowBelow"
| "deleteRow"
| "insertColumnLeft"
| "insertColumnRight"
| "deleteColumn"
| "hideRow"
| "showAllRows"
| "autoFitRow"
| "hideColumn"
| "showAllColumns"
| "autoFitColumn"
// … 4 more lines — see the API reference
}Built-in action names accepted by custom context-menu rows.API reference →;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: Gridinterface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(id: SheetId): void;
scrollToCell(addr: CellAddress): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(row: number, col: number): CellInputSnapshot | null;
getSelection(): Selection | null;
setSelection(sel: Selection | null): void;
setTheme(theme: Partial<Theme>): void;
replaceTheme(theme: Partial<Theme> | undefined): void;
// … 106 more lines — see the API reference
}interface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(id: SheetId): void;
scrollToCell(addr: CellAddress): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(row: number, col: number): CellInputSnapshot | null;
getSelection(): Selection | null;
setSelection(sel: Selection | null): void;
setTheme(theme: Partial<Theme>): void;
replaceTheme(theme: Partial<Theme> | undefined): void;
// … 106 more lines — see the API reference
}interface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(
id: SheetId,
): void;
scrollToCell(
addr: CellAddress,
): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(
row: number,
col: number,
): CellInputSnapshot | null;
getSelection(): Selection | null;
// … 229 more lines — see the API reference
}Imperative grid handle for document commands, events, rendering, and teardown.API reference →, cell: CellAddressinterface CellAddress {
sheet: SheetId;
row: number;
col: number;
}interface CellAddress {
sheet: SheetId;
row: number;
col: number;
}interface CellAddress {
sheet: SheetId;
row: number;
col: number;
}Zero-based address of one cell on a stable sheet ID.API reference → | 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: ContextMenuContextinterface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}interface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}interface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}Cell and viewport coordinates resolved for one bundled context-menu opening.API reference →) => boolean);Static or request-aware visibility. Hidden separators are normalized.
disabled Static or context-aware disabled state.
disabled?: boolean | ((context: ContextMenuContextinterface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}interface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}interface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}Cell and viewport coordinates resolved for one bundled context-menu opening.API reference →) => boolean);Declaration
View full TypeScript declaration
export interface ContextMenuItem { id?: string; action?: ContextMenuActionNametype ContextMenuActionName =
| "cut"
| "copy"
| "paste"
| "clearContents"
| "merge"
| "unmerge"
| "insertRowAbove"
| "insertRowBelow"
| "deleteRow"
| "insertColumnLeft"
| "insertColumnRight"
| "deleteColumn"
| "hideRow"
| "showAllRows"
// … 8 more lines — see the API reference
}type ContextMenuActionName =
| "cut"
| "copy"
| "paste"
| "clearContents"
| "merge"
| "unmerge"
| "insertRowAbove"
| "insertRowBelow"
| "deleteRow"
| "insertColumnLeft"
| "insertColumnRight"
| "deleteColumn"
| "hideRow"
| "showAllRows"
// … 8 more lines — see the API reference
}type ContextMenuActionName =
| "cut"
| "copy"
| "paste"
| "clearContents"
| "merge"
| "unmerge"
| "insertRowAbove"
| "insertRowBelow"
| "deleteRow"
| "insertColumnLeft"
| "insertColumnRight"
| "deleteColumn"
| "hideRow"
| "showAllRows"
| "autoFitRow"
| "hideColumn"
| "showAllColumns"
| "autoFitColumn"
// … 4 more lines — see the API reference
}Built-in action names accepted by custom context-menu rows.API reference →; onClick?: (grid: Gridinterface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(id: SheetId): void;
scrollToCell(addr: CellAddress): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(row: number, col: number): CellInputSnapshot | null;
getSelection(): Selection | null;
setSelection(sel: Selection | null): void;
setTheme(theme: Partial<Theme>): void;
replaceTheme(theme: Partial<Theme> | undefined): void;
// … 106 more lines — see the API reference
}interface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(id: SheetId): void;
scrollToCell(addr: CellAddress): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(row: number, col: number): CellInputSnapshot | null;
getSelection(): Selection | null;
setSelection(sel: Selection | null): void;
setTheme(theme: Partial<Theme>): void;
replaceTheme(theme: Partial<Theme> | undefined): void;
// … 106 more lines — see the API reference
}interface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(
id: SheetId,
): void;
scrollToCell(
addr: CellAddress,
): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(
row: number,
col: number,
): CellInputSnapshot | null;
getSelection(): Selection | null;
// … 229 more lines — see the API reference
}Imperative grid handle for document commands, events, rendering, and teardown.API reference →, cell: CellAddressinterface CellAddress {
sheet: SheetId;
row: number;
col: number;
}interface CellAddress {
sheet: SheetId;
row: number;
col: number;
}interface CellAddress {
sheet: SheetId;
row: number;
col: number;
}Zero-based address of one cell on a stable sheet ID.API reference → | null) => void; label?: string; shortcut?: string; visible?: boolean | ((context: ContextMenuContextinterface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}interface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}interface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}Cell and viewport coordinates resolved for one bundled context-menu opening.API reference →) => boolean); disabled?: boolean | ((context: ContextMenuContextinterface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}interface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}interface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}Cell and viewport coordinates resolved for one bundled context-menu opening.API reference →) => boolean);}