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 30

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.

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;
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;
onReady Fires after the adapter publishes a ready Grid generation.
onReady?: (event: GridReadyEvent) => void;
onInitializationError Receives a WASM initialization failure while the adapter remains mounted.
onInitializationError?: (error: unknown) => 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 extends Omit<
HTMLAttributes<HTMLDivElement>,
keyof GridAdapterEventHandlers | "children"
> {
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;
theme?: Partial<Theme>;
readOnly?: boolean;
protectionResolver?: ProtectionResolver;
mutationPolicy?: MutationPolicyMode;
transactionResourceLimits?: Partial<TransactionResourceLimits>;
renderers?: Record<string, CellRenderer>;
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;
onReady?: (event: GridReadyEvent) => void;
onInitializationError?: (error: unknown) => void;
wasmSource?: BufferSource | URL | string | Request | WebAssembly.Module;
}