Grid Pro overview and activationPro
What Grid Pro adds to Birch UI Grid, how to install and register its modules, and how to activate a license key.
Grid Pro is the commercial layer on top of the MIT-licensed Birch UI Grid. It does not replace the grid: you keep calling createGrid() from @birchui/core, and you add Pro features by passing modules from @birchui/grid-pro in the modules option. Everything you already know about columns, sorting, filtering and editing carries over unchanged.
What Grid Pro adds#
| Feature | Module | Options it reads | Guide |
|---|---|---|---|
| Row grouping and the group panel | RowGroupingModule |
groupBy, rowGroup, groupPanel, groupDefaultExpanded, groupColumn, groupTotals |
Row grouping |
| Aggregation | AggregationModule |
aggFunc on columns |
Aggregation |
| Tree data | TreeDataModule |
treeData, getDataPath, getParentId |
Tree data |
| Pivot mode | PivotModule |
pivot |
Pivoting |
| Range selection | RangeSelectionModule |
rangeSelection |
Range selection |
| Clipboard copy, cut and paste | ClipboardModule |
clipboard (on by default) |
Clipboard |
| Fill handle | FillHandleModule |
fillHandle, with range selection on |
Fill handle |
| Master/detail rows | MasterDetailModule |
masterDetail |
Master/detail |
| Status bar | StatusBarModule |
statusBar |
Status bar |
| Styled Excel export and import | ExcelModule |
none; adds API methods and a column menu item | Excel export & import |
All of these options are part of the regular GridOptions type, so they are typed and documented in one place. An option only takes effect when the module that reads it is installed. If you set groupBy without RowGroupingModule, the grid ignores the option and logs one console warning that names the missing module.
You can change the installed modules at runtime with api.update({ modules }). Modules you add are installed, and modules you leave out are uninstalled and clean up after themselves.
Install#
Grid Pro depends on the grid core, the license verifier and the Excel Engine. npm installs the last two for you.
npm install @birchui/core @birchui/grid-proThe package is ESM only and has no side effects on import, so it is safe to import in server-rendered code. All DOM work starts inside createGrid(). Styles for Pro features are injected automatically the first time a module is installed. If you set injectStyles: false on the grid, import the stylesheet yourself:
import '@birchui/core/styles.css';
import '@birchui/grid-pro/styles.css';Register modules#
Pass the modules you need. Each module is a small object with a name and an install() function. Bundlers drop the modules you do not import.
import { createGrid, type ColumnDef } from '@birchui/core';
import { RowGroupingModule, AggregationModule, StatusBarModule } from '@birchui/grid-pro';
interface Sale {
id: string;
region: 'EMEA' | 'North America' | 'APAC' | 'LATAM';
country: string;
rep: string;
product: string;
units: number;
revenue: number;
}
const sales: Sale[] = [
{ id: 'S-2041', region: 'EMEA', country: 'Germany', rep: 'Lena Fischer', product: 'Edge Router X2', units: 40, revenue: 18400 },
{ id: 'S-2042', region: 'EMEA', country: 'France', rep: 'Hugo Martin', product: 'Fleet Tracker', units: 12, revenue: 5520 },
{ id: 'S-2043', region: 'North America', country: 'Canada', rep: 'Maya Singh', product: 'Edge Router X2', units: 75, revenue: 33750 },
{ id: 'S-2044', region: 'APAC', country: 'Japan', rep: 'Kenji Ito', product: 'Sensor Hub', units: 30, revenue: 11970 },
];
const columns: ColumnDef<Sale>[] = [
{ field: 'region', rowGroup: true },
{ field: 'country', rowGroup: true },
{ field: 'rep', header: 'Sales rep' },
{ field: 'product' },
{ field: 'units', type: 'number', aggFunc: 'sum' },
{ field: 'revenue', type: 'number', aggFunc: 'sum', format: (v) => `$${Number(v).toLocaleString('en-US')}` },
];
const api = createGrid(document.querySelector<HTMLElement>('#sales')!, {
columns,
rows: sales,
getRowId: (row) => row.id,
modules: [RowGroupingModule, AggregationModule, StatusBarModule],
groupDefaultExpanded: 1,
statusBar: true,
});To turn on everything at once, use AllProModules. It is convenient for prototypes and internal tools. Production bundles are smaller when you list the modules you use.
import { AllProModules } from '@birchui/grid-pro';
createGrid(container, { columns, rows, modules: AllProModules });Modules can be combined with your own custom modules in the same array. Order does not matter; each module registers pipeline stages with a fixed position, so grouping always runs after filtering and sorting.
Use Grid Pro in your framework#
The framework adapters pass options straight through to createGrid(), so modules and every Pro option work the same way everywhere. Define the modules array once, outside your component, so its identity stays stable between renders.
import { createGrid } from '@birchui/core';
import { AllProModules } from '@birchui/grid-pro';
const api = createGrid(document.getElementById('sales')!, {
columns,
rows: sales,
modules: AllProModules,
groupBy: ['region'],
licenseKey: import.meta.env.VITE_BIRCHUI_LICENSE_KEY,
});import { BirchGrid } from '@birchui/react';
import { AllProModules } from '@birchui/grid-pro';
const modules = AllProModules;
export function SalesGrid({ sales }: { sales: Sale[] }) {
return (
<BirchGrid<Sale>
style={{ height: 480 }}
columns={columns}
rows={sales}
modules={modules}
groupBy={['region']}
onRowExpanded={(e) => console.log(e.rowId, e.expanded)}
/>
);
}<script setup lang="ts">
import { BirchGrid } from '@birchui/vue';
import { AllProModules } from '@birchui/grid-pro';
defineProps<{ sales: Sale[] }>();
const modules = AllProModules;
</script>
<template>
<BirchGrid
style="height: 480px"
:columns="columns"
:rows="sales"
:modules="modules"
:group-by="['region']"
@row-expanded="(e) => console.log(e.rowId, e.expanded)"
/>
</template>import { Component, input } from '@angular/core';
import { BirchGridComponent } from '@birchui/angular';
import { AllProModules } from '@birchui/grid-pro';
import type { GridOptions } from '@birchui/core';
@Component({
selector: 'app-sales-grid',
standalone: true,
imports: [BirchGridComponent],
template: `
<birchui-grid
style="height: 480px"
[columns]="columns"
[rows]="sales()"
[options]="options"
(rowExpanded)="onExpanded($event)"
/>
`,
})
export class SalesGridComponent {
readonly sales = input<Sale[]>([]);
readonly columns = columns;
readonly options: Partial<GridOptions<Sale>> = { modules: AllProModules, groupBy: ['region'] };
onExpanded(e: { rowId: string; expanded: boolean }) {
console.log(e.rowId, e.expanded);
}
}<script lang="ts">
import { BirchGrid } from '@birchui/svelte';
import { AllProModules } from '@birchui/grid-pro';
let { sales }: { sales: Sale[] } = $props();
const modules = AllProModules;
</script>
<BirchGrid style="height: 480px" {columns} rows={sales} {modules} groupBy={['region']} />The framework guides cover typed generics, refs to the grid API and server-side rendering for each adapter.
Calling Pro API methods#
Pro modules add methods to the grid API object when they install, and remove them when they are uninstalled.
Importing @birchui/grid-pro declares these methods on GridApi as optional members, because each one exists only while the module that provides it is installed. Call them with optional chaining, or check for the module first:
import { RangeSelectionModule } from '@birchui/grid-pro';
if (api.hasModule(RangeSelectionModule.name)) {
console.log(api.getCellRanges?.());
}
await api.exportExcel?.({ fileName: 'q3-sales.xlsx' });
api.setGroupBy?.(['region', 'rep']);
const revenue = api.getColumnAggregate?.('revenue');| Module | Methods |
|---|---|
RowGroupingModule |
setGroupBy(), getGroupBy(), expandToLevel() |
AggregationModule |
getColumnAggregate() |
TreeDataModule |
expandToLevel() |
PivotModule |
setPivot(), getPivotResult(), expandToLevel() |
RangeSelectionModule |
getCellRanges(), setCellRange(), addCellRange(), clearCellRanges(), getRangeValues(), onRangeChanged() |
ClipboardModule |
copyToClipboard(), cutToClipboard(), pasteFromClipboard(), pasteText() |
MasterDetailModule |
setDetailExpanded(), isDetailExpanded() |
ExcelModule |
exportExcel(), getExcelBlob(), buildExcelWorkbook(), importExcel() |
Module names, for hasModule(), are rowGrouping, aggregation, treeData, pivot, rangeSelection, clipboard, fillHandle, masterDetail, statusBar and excel. Each module object exposes its name as .name.
Activate your license key#
Your key arrives by email after purchase, and you can retrieve it again from the customer portal. It looks like LQ1.eyJ2IjoxLCJpZCI6... followed by a signature. There are two ways to give it to the grid.
Set the key once for the whole app#
Call setLicenseKey() from @birchui/license before or after creating grids. Every Birch UI widget that has no key of its own picks it up, including grids that already exist; their watermark disappears as soon as the key is verified.
import { setLicenseKey } from '@birchui/license';
setLicenseKey(import.meta.env.VITE_BIRCHUI_LICENSE_KEY);This is the recommended approach. One call covers Grid Pro, the Scheduler and any other Birch UI product your key includes.
Pass the key to one grid#
The licenseKey grid option takes precedence over the global key. Use it when different parts of a page are licensed separately, for example in a micro-frontend.
createGrid(container, {
columns,
rows,
modules: AllProModules,
licenseKey: 'LQ1.eyJ2IjoxLCJpZCI6...',
});The grid reads licenseKey when the first Pro module installs, so set it in the options you pass to createGrid(). A grid created with its own key ignores later setLicenseKey() calls.
What happens without a valid key#
Birch UI never disables a feature because of licensing. When the key is missing, malformed, signed for a different product or an expired trial:
- every Pro feature keeps working exactly as it does with a key;
- the grid shows a small, non-interactive watermark in its bottom-right corner, for example
Birch UI Grid Pro · unlicensed copy · birchui.com/pricing; - the console shows one warning per product per page load, explaining what is wrong with the key.
On localhost, 127.0.0.1, [::1] and hostnames ending in .localhost or .local, the watermark is not shown, so local development stays clean. The console warning still appears, which helps you notice a missing key before you deploy.
Verification happens in the browser against a public key embedded in the package. There are no network calls, no activation server and no phone-home. Paid keys never expire, which is how free updates forever work offline: a newer version of Grid Pro accepts the same key.
Next steps#
- Group rows and add totals: Row grouping and Aggregation.
- Turn a flat list into a report: Pivoting.
- Give users spreadsheet-style interaction: Range selection, Clipboard and Fill handle.
- Hand data to Excel: Excel export & import.
- Look up every option:
GridOptionsreference and the@birchui/grid-proAPI.