React pivot table

Pivot mode with row and grand totals for React, inside the same grid your users already know.

Grid Pro

v1 launch

$349

Per developer, paid once, lifetime updates

A working starting point

npm install @birchui/react @birchui/core @birchui/grid-pro
Show pivot-table.jsx
pivot-table.jsx
import { BirchGrid } from '@birchui/react';
import { PivotModule } from '@birchui/grid-pro';

const sales = [
  { id: 'SO-10421', region: 'Europe', country: 'France', year: 2026, revenue: 1890.5 },
  { id: 'SO-10422', region: 'Europe', country: 'Germany', year: 2025, revenue: 459 },
  { id: 'SO-10423', region: 'North America', country: 'Canada', year: 2026, revenue: 712.25 },
];

const columns = [
  { field: 'region', header: 'Region' },
  { field: 'year', header: 'Year', type: 'number' },
  { field: 'revenue', header: 'Revenue', type: 'number' },
];
const modules = [PivotModule];
const pivot = {
  enabled: true,
  rows: ['region'],
  columns: ['year'],
  values: [{ colId: 'revenue', aggFunc: 'sum' }],
  totals: true,
};

export function PivotTable() {
  return (
    <BirchGrid
      style={{ height: 520 }}
      licenseKey={'LQ1.your-key'}
      modules={modules}
      columns={columns}
      rows={sales}
      pivot={pivot}
    />
  );
}

Measured in Chrome: pivoting 100,000 rows takes 52–93 ms. For an end-user report builder, see Pivot Studio.

How it fits React

Pivot mode turns rows into columns such as 2026 › Q1 › Revenue, with row and grand totals and sorting by any pivot column. It is part of Grid Pro, so a React team that needs pivoting buys one product, not an enterprise suite.

The React adapter is a thin component around the pivot table engine. Props that change by identity go to update(); the widget is never recreated, so StrictMode double effects and re-renders cost nothing.

Keep columns, option objects and callbacks stable at module scope or in useMemo, and pass a new array when rows change. The package ships the "use client" directive, so it drops into the Next.js App Router. On the server it renders an empty container.

Questions

Can React users drag fields to build their own pivot?

Grid Pro pivots from options you set in code. Pivot Studio adds a drag-and-drop field list, drill-through and saved reports.

Can I export the pivot to Excel?

Yes. The Excel module exports the current view, pivot columns and totals included, as a styled xlsx file.

Does the React pivot table work with Next.js server components?

Render it from a client component. The adapter carries "use client", imports nothing from window, and mounts in a layout effect.

How do I reach the imperative API from React?

Pass a ref. It holds the widget API after mount and null after unmount, typed from your row or event type.