Web Component pivot table

Pivot mode with row and grand totals for Web Components, 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/element @birchui/core @birchui/grid-pro
Show index.html
index.html
<birchui-grid style="display: block; height: 520px"></birchui-grid>

<script type="module">
  import { defineBirchGrid } from '@birchui/element';
  import { PivotModule } from '@birchui/grid-pro';

  defineBirchGrid();

  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,
  };

  const el = document.querySelector('birchui-grid');
  el.licenseKey = 'LQ1.your-key';
  el.modules = modules;
  el.columns = columns;
  el.rows = sales;
  el.pivot = pivot;

</script>

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

How it fits Web Components

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 Web Components team that needs pivoting buys one product, not an enterprise suite.

The element package registers the pivot table as a light-DOM custom element. There is no Shadow DOM, so your CSS and the --fe-* theme properties reach every cell.

Set rich options as properties, simple ones as attributes. Only changed keys reach update(). Importing the package never touches HTMLElement, so shared code is safe on the server; define the element in the browser.

Questions

Can Web Components 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.

Can I use the pivot table element without a build step?

Yes, from any ES module setup, including server-rendered pages, Rails, Django, Laravel or plain HTML with an import map.

How are events delivered?

As bubbling, composed CustomEvents with kebab-case names and the payload in detail.