Skip to content
Sheetwrite

Sheetwrite / Documentation

GridConfig@sheetwrite/core

Toolbar / feature configuration.

Toolbar / feature configuration. When config is set the built-in toolbar is shown; control flags default to true except the opt-in export flag.

Members 17

toolbar Show the built-in toolbar (true), hide it (false), or supply a custom item list.
toolbar?: boolean | ToolbarItem[];
bold Show the bold control in the default toolbar (default true).
bold?: boolean;
italic Show the italic control in the default toolbar (default true).
italic?: boolean;
align Show left, center, and right alignment controls (default true).
align?: boolean;
textColor Show the text-color control in the default toolbar (default true).
textColor?: boolean;
fillColor Show the fill-color control in the default toolbar (default true).
fillColor?: boolean;
border Show the border control in the default toolbar (default true).
border?: boolean;
clearFormat Show the clear-format control in the default toolbar (default true).
clearFormat?: boolean;
merge Show merge and unmerge controls in the default toolbar (default true).
merge?: boolean;
sort Show ascending and descending sort controls in the default toolbar (default true).
sort?: boolean;
export Show CSV/XLSX export controls in the default toolbar (default false).
export?: boolean;
icons Override built-in toolbar icons by action name.
icons?: Partial<Record<ToolbarActionName, ToolbarIcon>>;

Override built-in toolbar icons by action name. Strings render as plain text; DOM nodes/factories support SVG/HTML icons.

contextMenu Built-in menu, disabled menu, static rows, or a request-aware row factory.
contextMenu?: boolean | ContextMenuItems;
undo Show undo/redo controls in the built-in toolbar (default true).
undo?: boolean;
find Built-in Ctrl+F find widget: enabled (true, default) or disabled (false).
find?: boolean;
tabs Bottom sheet-tab bar for multi-sheet workbooks (default true).
tabs?: boolean;
keyboard Built-in keyboard handling.
keyboard?: boolean | ((e: KeyboardEvent, grid: Grid) => boolean);

Built-in keyboard handling. `true` (default) keeps the stock Sheets-style bindings (navigation, type-to-edit, clipboard, undo/redo, find). `false` disables ALL of them — the host owns key events and drives `grid.actions`, selection, editing, and search primitives itself. A function is consulted first and consumes the event by returning `true`; returning `false` falls through to the stock bindings.

Declaration

View full TypeScript declaration
export interface GridConfig {
toolbar?: boolean | ToolbarItem[];
bold?: boolean;
italic?: boolean;
align?: boolean;
textColor?: boolean;
fillColor?: boolean;
border?: boolean;
clearFormat?: boolean;
merge?: boolean;
sort?: boolean;
export?: boolean;
icons?: Partial<Record<ToolbarActionName, ToolbarIcon>>;
contextMenu?: boolean | ContextMenuItems;
undo?: boolean;
find?: boolean;
tabs?: boolean;
keyboard?: boolean | ((e: KeyboardEvent, grid: Grid) => boolean);
}