Skip to content

RenderOptions

type RenderOptions = {
allowHeaderSelections?: boolean;
allowRangeSelections?: boolean;
headers?: boolean;
headerStyle?: Style;
hiddenStyle?: Style;
highlightColor?: string;
locale?: string;
onCellContent?: (this: Renderer, eventData: {
cell: Cell;
ctx: CanvasRenderingContext2D;
rect: Rect;
}) => undefined | boolean;
showAnnotations?: boolean;
showHidden?: boolean;
showValuelessFormulas?: boolean;
};

Configuration options for rendering a grid

PropertyTypeDescription
allowHeaderSelections?booleanWhether users can select row/column headers
allowRangeSelections?booleanWhether users can select ranges of cells
headers?booleanWhether to display row and column headers
headerStyle?StyleStyle to apply to header cells
hiddenStyle?StyleStyle to apply to hidden cells
highlightColor?stringDefault color used for highlighting selected ranges
locale?stringLocale string in BCP 47 format for formatting numbers and dates (eg. “en”, “en-CA”)
onCellContent?(this: Renderer, eventData: { cell: Cell; ctx: CanvasRenderingContext2D; rect: Rect; }) => undefined | booleanA callback that will be called for each cell that is rendered, and can be used to draw custom content in the cell. If it returns false, the default content will not be rendered.
showAnnotations?booleanWhether to draw a visual indicator on a cell when it has unresolved comments or notes. Defaults to true.
showHidden?booleanWhether to display hidden rows and columns
showValuelessFormulas?booleanWhether or not to display formulas in cells that have a formula but no calculated value. Excel itself will always calculate values for formulas, but some libraries are not always so conscientious.