gridcn2.0.0
Performance

Bundle size

See what the core grid and each add-on add to your JavaScript bundle, which parts load on first use, and how to measure your own build.

gridcn copies its source into your project, so your bundler builds the grid with your app. The size depends on what you import and on your bundler settings. This page lists what each part brings in. Measure your own build for exact numbers.

PartWhat it adds to the bundleWhen it loads
Core (data-grid)About 555 KiB minified, 190 KiB gzip, with React left out. See Core.With the grid
data-grid-iopapaparse for CSV import. The xlsx reader and writer of hucre.papaparse with the add-on. hucre on the first xlsx or xls file. See Parts that load on first use.
data-grid-toolbar, data-grid-sort-list@dnd-kit/dom and @dnd-kit/react for drag to reorderWith the toolbar or sort list import. A bundler that tree-shakes drops it from a toolbar import that uses no filter menu. data-grid-sort-list always loads it.
data-grid-url-statenuqsWith the URL state hooks
Other add-onsTheir own source and the shadcn/ui components they use. Their npm packages, such as lucide-react and zustand, are packages of the core too.With the add-on

Install gridcn lists the npm packages and the shadcn/ui components of every add-on.

Core

A measurement of the core import (data-grid.tsx, esbuild, minified, React external) gave 555 KiB, or 190 KiB gzip (1 KiB is 1,024 bytes). The size counts the entry chunk and its shared chunk, and leaves out the date picker chunk. The numbers change with each release, so run the recipe in Measure your build for your version.

ShareMinified size (KiB)
gridcn code326
@base-ui/react156
cn25

The shadcn/ui components of the core, such as button, popover, and calendar, are files in your project. If your app already uses them, the grid shares them and adds nothing for them.

Parts that load on first use

The date picker loads on the first calendar open. react-day-picker and date-fns add about 72 KiB minified, or 22 KiB gzip, in a chunk of their own. A grid without a date column never fetches it.

data-grid-io imports the xlsx reader and the xlsx writer with a dynamic import(). Your bundler puts each one in its own chunk. The browser fetches the chunk on the first xlsx or xls import, or on the first xlsx export. CSV import and export never fetch it.

The rest of gridcn loads with the module that imports it. To defer a whole add-on, import the component that uses it with React.lazy or next/dynamic.

Measure your build

In a Next.js app, run next build before and after you add the grid. Compare the "First Load JS" of the route that renders it.

To measure one import outside your app, bundle it with esbuild and gzip the result. Splitting keeps the date picker in a chunk of its own:

echo 'export * from "./components/data-grid/data-grid";' > grid-entry.ts
npx esbuild grid-entry.ts --bundle --minify --format=esm \
  --external:react --external:react-dom --splitting --outdir=out
cat out/grid-entry.js out/chunk-*.js | gzip -c | wc -c

The recipe prints bytes for the entry chunk and its shared chunks. Divide by 1,024 for KiB.

esbuild reads the @/ alias from tsconfig.json. Add an add-on to the entry file to see what it adds to the core.

On this page