Host element and configuration used to create the built-in toolbar.
- Package
@sheetwrite/core/shell
- Source
packages/core/src/shell/toolbar-factory.ts#L12
Members 3
items Items to render; defaults to the full built-in action set.
items?: readonly ToolbarIteminterface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}interface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}interface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}Built-in, separator, or custom callback item in the grid toolbar.API reference →[];
icons Per-action icon overrides, exactly like GridConfig.icons.
icons?: Partial<Record<ToolbarActionNametype ToolbarActionName =
| "bold"
| "italic"
| "underline"
| "strikethrough"
| "alignLeft"
| "alignCenter"
| "alignRight"
| "textColor"
| "fillColor"
| "border"
| "clearFormat"
| "merge"
| "unmerge"
| "sortAsc"
// … 6 more lines — see the API reference
}type ToolbarActionName =
| "bold"
| "italic"
| "underline"
| "strikethrough"
| "alignLeft"
| "alignCenter"
| "alignRight"
| "textColor"
| "fillColor"
| "border"
| "clearFormat"
| "merge"
| "unmerge"
| "sortAsc"
// … 6 more lines — see the API reference
}type ToolbarActionName =
| "bold"
| "italic"
| "underline"
| "strikethrough"
| "alignLeft"
| "alignCenter"
| "alignRight"
| "textColor"
| "fillColor"
| "border"
| "clearFormat"
| "merge"
| "unmerge"
| "sortAsc"
| "sortDesc"
| "exportCsv"
| "exportXlsx"
| "undo"
// … 2 more lines — see the API reference
}Built-in action names accepted by custom toolbar items.API reference →, ToolbarIcontype ToolbarIcon = string | Node | (() => Node);type ToolbarIcon = string | Node | (() => Node);type ToolbarIcon =
string | Node | (() => Node);Text, DOM node, or node factory used as toolbar icon content.API reference →>>;
label Accessible toolbar label (default "Spreadsheet formatting").
Declaration
View full TypeScript declaration
export interface ToolbarOptions {
items?: readonly ToolbarIteminterface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}interface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}interface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}Built-in, separator, or custom callback item in the grid toolbar.API reference →[]; icons?: Partial<Record<ToolbarActionNametype ToolbarActionName =
| "bold"
| "italic"
| "underline"
| "strikethrough"
| "alignLeft"
| "alignCenter"
| "alignRight"
| "textColor"
| "fillColor"
| "border"
| "clearFormat"
| "merge"
| "unmerge"
| "sortAsc"
// … 6 more lines — see the API reference
}type ToolbarActionName =
| "bold"
| "italic"
| "underline"
| "strikethrough"
| "alignLeft"
| "alignCenter"
| "alignRight"
| "textColor"
| "fillColor"
| "border"
| "clearFormat"
| "merge"
| "unmerge"
| "sortAsc"
// … 6 more lines — see the API reference
}type ToolbarActionName =
| "bold"
| "italic"
| "underline"
| "strikethrough"
| "alignLeft"
| "alignCenter"
| "alignRight"
| "textColor"
| "fillColor"
| "border"
| "clearFormat"
| "merge"
| "unmerge"
| "sortAsc"
| "sortDesc"
| "exportCsv"
| "exportXlsx"
| "undo"
// … 2 more lines — see the API reference
}Built-in action names accepted by custom toolbar items.API reference →, ToolbarIcontype ToolbarIcon = string | Node | (() => Node);type ToolbarIcon = string | Node | (() => Node);type ToolbarIcon =
string | Node | (() => Node);Text, DOM node, or node factory used as toolbar icon content.API reference →>>;