A working starting point
npm install @birchui/svelte @birchui/core @birchui/grid-proShow Pivot-table.svelte
<script>
import { BirchGrid } from '@birchui/svelte';
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,
};
</script>
<BirchGrid
style="height: 520px"
licenseKey={'LQ1.your-key'}
{modules}
{columns}
rows={sales}
{pivot}
/>Measured in Chrome: pivoting 100,000 rows takes 52–93 ms. For an end-user report builder, see Pivot Studio.
How it fits Svelte
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 Svelte team that needs pivoting buys one product, not an enterprise suite.
The Svelte package offers the pivot table both as a component and as a use: action. Components ship as .svelte source and compile with your app through the svelte export condition.
Keep large arrays and the bound api in $state.raw. Deep $state would proxy every record for no gain. During SvelteKit SSR the component renders its empty container, and the widget is created in an effect in the browser.
Questions
Can Svelte 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.
Is the Svelte pivot table written for Svelte 5?
Yes. Props and handlers follow runes, and the action form fits markup where a component would be in the way.
Is Svelte a second-class target?
No. The Svelte adapter runs the same smoke tests in CI as React, Vue and Angular, over the same engine.
Same engine, other pairings
Every Birch UI product runs in every adapter.