Documentation

Installation

Install the React bindings (the framework-agnostic core comes with them):

npm i @kanunilabs/datagrid-react

(Any package manager works — yarn add / pnpm add too.)

To try it before installing anything, open a ready project — React or plain JavaScript — that runs in your browser:

Runs in your browser: installs from npm and starts Vite. Nothing to set up.

React is the only required peer dependency. There are no other runtime dependencies to install.

Not using React? @kanunilabs/datagrid is the same grid over the same engine, driven by a plain createGrid() call — no framework peer at all. The JavaScript guide covers it end to end, including the Enterprise edition via createEnterpriseGrid().

npm i @kanunilabs/datagrid

Styles

Import the stylesheet once, near your app root:

import '@kanunilabs/datagrid-react/styles.css';

The stylesheet is plain CSS scoped under .kanuni-datagrid-root, so it cannot leak into your app and your app's CSS cannot leak into the grid. Theming is done with CSS custom properties — see Features → Theming.

The Web Worker: nothing to configure

Above roughly 20,000 rows the grid moves filtering and sorting into a Web Worker. The worker is compiled into the package and started from a Blob URL, so there is no file to copy, no bundler recipe and nothing to import — Vite, webpack, Next.js and Parcel all work as they are.

You can still control the offload:

<DataGrid worker={{ enabled: false }} />          {/* always main thread */}
<DataGrid worker={{ threshold: 50_000 }} />        {/* offload later */}

If you have a strict Content-Security-Policy

A Blob worker needs worker-src to allow blob::

Content-Security-Policy: worker-src 'self' blob:

If you cannot change the policy, serve the worker as a file instead. It ships in the package either way, and pointing at it opts out of the Blob entirely.

Vite — import the worker as an asset URL:

import workerUrl from '@kanunilabs/datagrid-core/dist/datagrid.worker.js?url';

<DataGrid worker={{ url: workerUrl }} /* ... */ />

Next.js and other bundlers — copy datagrid.worker.js from node_modules/@kanunilabs/datagrid-core/dist/ into a served path (e.g. public/) and point at it:

<DataGrid worker={{ url: '/datagrid.worker.js' }} /* ... */ />

Copy the file again every time you upgrade the package. A copied worker from an older version keeps answering, but it does not know options added since — for example, it sorts an absoluteSort column by signed value — and nothing reports the mismatch. A script that copies it on install (postinstall) removes the risk. The Vite import above always follows the installed version.

The same route is worth taking if you would rather serve the worker from a CDN, so it caches separately from your app bundle.

Excel export (optional)

CSV export needs nothing extra. For .xlsx, install the optional peer:

npm i exceljs

It is loaded lazily, so apps that never export to Excel don't pay for it. If it isn't installed, the Excel path reports an actionable error and CSV keeps working.

TypeScript

Types ship with the packages — no @types/* needed. The public API is fully typed, including GridColumnDef, ReactGridColumnDef, the filter AST and every event payload.

Server-side rendering

The grid renders on the server without a worker or DOM measurement and hydrates normally. Popups are created on mount, so nothing is portaled during SSR. See SSR & bundlers for the Next.js and Vite specifics.

Next: explore the features.

Versions that go together

Each package carries its own version number, so a release can ship @kanunilabs/datagrid and its React package at different numbers: a package moves only when its own code or a dependency changes. They are still released as one set. Install the latest of each; the paid packages pin the exact versions of the free ones they build on, so your package manager resolves a matching set. The current set, read from the changelog:

PackageCurrent version
@kanunilabs/datagrid-core1.10.14
@kanunilabs/datagrid1.9.14
@kanunilabs/datagrid-react1.8.14
@kanunilabs/datagrid-enterprise1.10.14
@kanunilabs/datagrid-react-enterprise1.9.14
@kanunilabs/datagrid-server1.1.1
@kanunilabs/licensing1.3.0