Skip to content

React ​

@ezygrid/react ships a thin, uncontrolled <Spreadsheet> component (peer dependencies: react and react-dom >= 18).

Install ​

Local workspace adapter

The @ezygrid/* adapters are built from this repository and are not published on public npm. The @bookklik/ezygrid package ships the framework-neutral editor. These instructions link a built local checkout; adjust the relative paths for your application.

bash
# Build the cloned Ezygrid checkout first: pnpm install && pnpm build
# From a consuming app beside the ezygrid checkout:
pnpm add @ezygrid/react@link:../ezygrid/packages/react @ezygrid/core@link:../ezygrid/packages/core @ezygrid/theme-default@link:../ezygrid/packages/theme-default

Usage ​

tsx
import { Spreadsheet } from '@ezygrid/react';
import '@ezygrid/theme-default/index.css';

export function Budget() {
  return (
    <Spreadsheet
      worksheets={[{ name: 'Budget', rows: 200, columns: 10, data: [['A', 'B'], [1, '=B1*2']] }]}
      renderer={{ formulaBar: true, toolbar: true }}
      style={{ height: 480 }}
      onReady={(workbook, renderer) => console.log('ready', workbook, renderer)}
    />
  );
}

Props ​

SpreadsheetProps flattens workbook options at the top level plus:

PropTypeDescription
worksheets, id, extensionsCreateGridOptionsWorkbook options
rendererGridRendererOptionsPresentation options
onReady(workbook: Workbook, renderer: GridRenderer) => voidCalled once mounted
classNamestringHost container class
styleCSSPropertiesHost container styles (give it a height)

Uncontrolled by design ​

The workbook model owns state. Parent re-renders never repaint the grid; the component mounts once and hands you the workbook handle. Mutate data through the model, not props:

tsx
const ref = useRef<Workbook>();

<Spreadsheet onReady={(workbook) => { ref.current = workbook; }} />

// elsewhere
ref.current?.activeWorksheet.setValue(0, 0, 'Hello');

SSR ​

The component is SSR-safe: nothing touches the DOM until mounted on the client.

Released under the MIT License.