Skip to content
Sheetwrite

Sheetwrite / Documentation

GridOptions@sheetwrite/core

Workbook, data, rendering, policy, and built-in UI options used to create a Grid.

Workbook, data, rendering, policy, and built-in UI options used to create a Grid.

Members 15

workbook Live workbook schema adopted by the store and updated by document operations.
workbook: Workbook;
data Eager column-major values loaded into workbook.activeSheet; use instead of datasource.
data?: ColumnarData;
datasource Lazy row provider requested for visible windows; use instead of eager data.
datasource?: DataSource;
datasourceStorage Allocation and cache policy for datasource-backed cell storage.
datasourceStorage?: DataSourceStorageOptions;
renderer Paint backend; defaults to main-thread canvas and falls back there if a worker fails.
renderer?: "canvas" | "worker";
workerUrl URL of the worker renderer module (renderer: "worker"), as served to the BROWSER — the platform Worker constructor does not consult package exports, so a bare specifier like new URL("@sheetwrite/core/worker",…
workerUrl?: string | URL;

URL of the worker renderer module (`renderer: "worker"`), as served to the BROWSER — the platform `Worker` constructor does not consult package exports, so a bare specifier like `new URL("@sheetwrite/core/worker", import.meta.url)` is NOT reliable. Either copy `@sheetwrite/core/dist/worker.js` to your public assets and pass its URL string (works everywhere), or use your bundler's dependency-worker import if it has one (see `/docs/guides/worker-rendering/`). If omitted or the worker can't be constructed, the grid falls back to the main-thread canvas renderer and emits `renderer-fallback` once.

theme Overrides merged over the default theme and host CSS custom properties.
theme?: Partial<Theme>;
readOnly Disables mutating interactions while preserving navigation and selection.
readOnly?: boolean;
protectionResolver Host-owned client UX permission check.
protectionResolver?: ProtectionResolver;

Host-owned client UX permission check. Servers must independently authorize every submitted operation; this resolver is not an authentication boundary.

mutationPolicy Atomic rejects the transaction; partial skips denied operation objects.
mutationPolicy?: MutationPolicyMode;
transactionResourceLimits Overrides inclusive operation-count and encoded-byte ceilings for every atomic mutation.
transactionResourceLimits?: Partial<TransactionResourceLimits>;
renderers Custom cell renderers registered up front; also see Grid.defineCellRenderer.
renderers?: Record<string, CellRenderer>;
overscan Rows rendered above/below the viewport to absorb fast scrolls.
overscan?: number;
minColumns Render at least this many columns (empty padding columns past the data, like a spreadsheet).
minColumns?: number;
config Built-in UI controls; providing an object enables the toolbar unless toolbar is false.
config?: GridConfig;

Declaration

View full TypeScript declaration
export interface GridOptions {
workbook: Workbook;
data?: ColumnarData;
datasource?: DataSource;
datasourceStorage?: DataSourceStorageOptions;
renderer?: "canvas" | "worker";
workerUrl?: string | URL;
theme?: Partial<Theme>;
readOnly?: boolean;
protectionResolver?: ProtectionResolver;
mutationPolicy?: MutationPolicyMode;
transactionResourceLimits?: Partial<TransactionResourceLimits>;
renderers?: Record<string, CellRenderer>;
overscan?: number;
minColumns?: number;
config?: GridConfig;
}