Skip to content
Mondrian

RenderOptions

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

Configuration options for rendering a grid

Property Type Description
allowHeaderSelections? boolean Whether users can select row/column headers
allowRangeSelections? boolean Whether users can select ranges of cells
headers? boolean Whether to display row and column headers
headerStyle? Style Style to apply to header cells
hiddenStyle? Style Style to apply to hidden cells
highlightColor? string Default color used for highlighting selected ranges
locale? string Locale string in BCP 47 format for formatting numbers and dates (eg. “en”, “en-CA”)
onCellContent? (this: Renderer, eventData: { cell: Cell; ctx: | CanvaslikeRenderingContext2D | null; rect: Rect; }) => undefined | boolean A 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? boolean Whether to draw a visual indicator on a cell when it has unresolved comments or notes. Defaults to true.
showHidden? boolean Whether to display hidden rows and columns
showValuelessFormulas? boolean Whether 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.