Skip to content
Sheetwrite

Sheetwrite / Documentation

SheetwriteGridProps@sheetwrite/react

Advanced framework adapter props for workbook data or datasource ownership.

Advanced framework adapter props for workbook data or datasource ownership.

Members 40

rowBridge Projects canonical changes to host-owned row identities.
rowBridge?: RowBridge<Id>;
onRowDelta Receives one accepted or reconciled row projection.
onRowDelta?: RowBridgeHandler<Id>;
onMutationRejected Receives structured issues when a Grid mutation is rejected.
onMutationRejected?: GridAdapterEventHandlers["onMutationRejected"];
onRendererFallback Fires when worker rendering falls back to the main-thread canvas renderer.
onRendererFallback?: GridAdapterEventHandlers["onRendererFallback"];
onDatasourceError Receives failed datasource requests and their errors.
onDatasourceError?: GridAdapterEventHandlers["onDatasourceError"];
onExportError Receives failures from built-in XLSX export actions.
onExportError?: GridAdapterEventHandlers["onExportError"];
onReady Fires after the adapter publishes a ready Grid generation.
onReady?: GridAdapterEventHandlers["onReady"];
className Additional class appended to the required sheetwrite host class.
className?: string;
style Host styles merged before adapter sizing styles.
style?: CSSProperties;
fallback Content shown while WASM is loading or after initialization fails.
fallback?: ReactNode;
height Host height in CSS pixels for numbers or any CSS length string.
height?: number | string;
fill Fills the parent's available width and height, taking precedence over height.
fill?: true;
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.

presentation Header presentation. Spreadsheet mode (default) paints positional A/B/C labels; data-grid mode paints each column's semantic header.
presentation?: GridPresentation;

Header presentation. Spreadsheet mode (default) paints positional A/B/C labels; data-grid mode paints each column's semantic `header`. Cell addressing, row indices, clipboard values, formulas, and exports are unchanged in both modes.

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>;
editors Named custom editors resolved from each column's editor field.
editors?: Record<string, CellEditor>;
overscan Extra row and visible-column positions painted on each viewport edge.
overscan?: number;

Extra row and visible-column positions painted on each viewport edge. Defaults to 6; use 0 to disable the buffer.

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;
onGridChange Receives every committed Grid change, including its applied transaction.
onGridChange?: (event: ChangeEvent) => void;
onSelectionChange Receives the current selection, or null after it is cleared.
onSelectionChange?: (selection: Selection | null) => void;
onViewportChange Receives visible row bounds and vertical scroll offset after scrolling.
onViewportChange?: (event: GridEvents["scroll"]) => void;
onEditBegin Fires when cell editing begins.
onEditBegin?: (event: GridEvents["edit-begin"]) => void;
onEditCommit Fires after an edit commits its parsed cell value.
onEditCommit?: (event: GridEvents["edit-commit"]) => void;
onActiveSheetChange Fires after the visible sheet changes.
onActiveSheetChange?: (event: GridEvents["active-sheet"]) => void;
onCommandStateChange Receives observable undo/redo and formatting command state.
onCommandStateChange?: (event: GridEvents["command-state-change"]) => void;
onInitializationError Receives a WASM initialization failure while the adapter remains mounted.
onInitializationError?: (error: SheetwriteError) => void;
wasmSource Explicit source passed to process-wide WASM initialization; concurrent initialization is first-source-wins.
wasmSource?: BufferSource | URL | string | Request | WebAssembly.Module;

Declaration

View full TypeScript declaration
export interface SheetwriteGridProps<Id extends RowBridgeId = RowBridgeId> {
rowBridge?: RowBridge<Id>;
onRowDelta?: RowBridgeHandler<Id>;
onMutationRejected?: GridAdapterEventHandlers["onMutationRejected"];
onRendererFallback?: GridAdapterEventHandlers["onRendererFallback"];
onDatasourceError?: GridAdapterEventHandlers["onDatasourceError"];
onExportError?: GridAdapterEventHandlers["onExportError"];
onReady?: GridAdapterEventHandlers["onReady"];
className?: string;
style?: CSSProperties;
fallback?: ReactNode;
height?: number | string;
fill?: true;
workbook: Workbook;
data?: ColumnarData;
datasource?: DataSource;
datasourceStorage?: DataSourceStorageOptions;
renderer?: "canvas" | "worker";
workerUrl?: string | URL;
presentation?: GridPresentation;
theme?: Partial<Theme>;
readOnly?: boolean;
hyperlinkActivation?: "event-only" | "internal-navigation" | "disabled";
protectionResolver?: ProtectionResolver;
mutationPolicy?: MutationPolicyMode;
transactionResourceLimits?: Partial<TransactionResourceLimits>;
renderers?: Record<string, CellRenderer>;
editors?: Record<string, CellEditor>;
overscan?: number;
minColumns?: number;
config?: GridConfig;
onGridChange?: (event: ChangeEvent) => void;
onSelectionChange?: (selection: Selection | null) => void;
onViewportChange?: (event: GridEvents["scroll"]) => void;
onEditBegin?: (event: GridEvents["edit-begin"]) => void;
onEditCommit?: (event: GridEvents["edit-commit"]) => void;
onSearch?: (result: GridEvents["search"]) => void;
onActiveSheetChange?: (event: GridEvents["active-sheet"]) => void;
onCommandStateChange?: (event: GridEvents["command-state-change"]) => void;
onInitializationError?: (error: SheetwriteError) => void;
wasmSource?: BufferSource | URL | string | Request | WebAssembly.Module;
}