Birch UI v0.1
Pricing

Quick start

Build a sortable, filterable, editable orders grid in five minutes in React, Vue, Angular, Svelte, Solid, a Web Component or plain JavaScript.

Open .md

This guide builds the same orders grid in every supported framework. Pick your framework once in any tab group below; the choice is remembered on every page.

The finished grid sorts on header click, filters from a row under the headers, edits customer and status cells inline, selects rows with checkboxes and pins the order number to the left:

Orders grid

Loading demo…

View source

Sample data and small UI helpers are imported from the docs' demos/_shared.ts and demos/_scheduler-data.ts files.

demos/basic-grid.ts
import { createGrid, type ColumnDef } from '@birchui/core';
import { docsTheme, formatCurrency, makeOrders, onDocsThemeChange, revenueOf, type Order } from './_shared';

export const meta = { title: 'Orders grid', height: 420 };

const columns: ColumnDef<Order>[] = [
  { field: 'id', header: 'Order', width: 110 },
  { field: 'customer', header: 'Customer', flex: 1, minWidth: 180 },
  { field: 'region', header: 'Region', width: 140 },
  { field: 'product', header: 'Product', width: 190 },
  { field: 'quantity', header: 'Qty', type: 'number', width: 80 },
  { id: 'revenue', header: 'Revenue', type: 'number', width: 120, valueGetter: revenueOf, format: formatCurrency },
  { field: 'orderDate', header: 'Ordered', type: 'date', width: 120 },
];

export default function mount(el: HTMLElement): () => void {
  const grid = createGrid<Order>(el, {
    columns,
    rows: makeOrders(500),
    getRowId: (order) => order.id,
    theme: docsTheme(),
    ariaLabel: 'Customer orders',
  });
  const stopTheme = onDocsThemeChange((theme) => grid.update({ theme }));
  return () => {
    stopTheme();
    grid.destroy();
  };
}

1. Install#

Terminal
npm install @birchui/core @birchui/react

Styles are injected automatically when the grid is created. To import a CSS file instead, see Styles.

2. Describe your data#

Every example uses this module. Columns are plain objects: field reads a property of the row, header is the column title, and the other keys switch features on per column.

orders.ts
import type { ColumnDef } from '@birchui/core';

export interface Order {
  id: string;
  customer: string;
  region: 'EMEA' | 'Americas' | 'APAC';
  placedAt: string;
  status: 'open' | 'shipped' | 'cancelled';
  total: number;
}

const usd = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' });

export const columns: ColumnDef<Order>[] = [
  { field: 'id', header: 'Order', width: 120, pinned: 'left' },
  { field: 'customer', header: 'Customer', flex: 1, minWidth: 180, filter: 'text', editable: true },
  { field: 'region', header: 'Region', filter: 'set' },
  { field: 'placedAt', header: 'Placed', type: 'date', filter: 'date' },
  {
    field: 'status',
    header: 'Status',
    filter: 'set',
    editable: true,
    editor: 'select',
    options: ['open', 'shipped', 'cancelled'],
  },
  { field: 'total', header: 'Total', type: 'number', filter: 'number', format: (value) => usd.format(Number(value)) },
];

export const orders: Order[] = [
  { id: 'SO-10421', customer: 'Northwind Traders', region: 'EMEA', placedAt: '2026-11-02', status: 'open', total: 1840.5 },
  { id: 'SO-10422', customer: 'Contoso Ltd', region: 'Americas', placedAt: '2026-11-03', status: 'shipped', total: 312 },
  { id: 'SO-10423', customer: 'Fabrikam Inc', region: 'Americas', placedAt: '2026-11-03', status: 'cancelled', total: 96.4 },
  { id: 'SO-10424', customer: 'Tailspin Toys', region: 'APAC', placedAt: '2026-11-05', status: 'open', total: 2210 },
  { id: 'SO-10425', customer: 'Litware Inc', region: 'EMEA', placedAt: '2026-11-06', status: 'shipped', total: 764.25 },
  { id: 'SO-10426', customer: 'Adventure Works', region: 'APAC', placedAt: '2026-11-07', status: 'open', total: 5120 },
];

export const getRowId = (order: Order) => order.id;

3. Render the grid#

OrdersGrid.tsx
import { useRef } from 'react';
import { BirchGrid } from '@birchui/react';
import type { GridApi } from '@birchui/core';
import { columns, getRowId, orders, type Order } from './orders';

export function OrdersGrid() {
  const grid = useRef<GridApi<Order>>(null);

  return (
    <>
      <button type="button" onClick={() => grid.current?.downloadCsv({ fileName: 'orders.csv' })}>
        Export CSV
      </button>
      <BirchGrid<Order>
        ref={grid}
        style={{ height: 420 }}
        columns={columns}
        rows={orders}
        getRowId={getRowId}
        floatingFilters
        rowSelection="multiple"
        checkboxSelection
        onCellValueChanged={({ row, colId, newValue }) => console.info(row.id, colId, newValue)}
      />
    </>
  );
}

4. Try it#

With the grid on screen:

  • Sort: click a header. Shift-click another header to add a second sort column.
  • Filter: type in the row under the headers. In the Total column, try >1000 or 300..2000.
  • Edit: double-click a customer or status cell, or focus it and start typing. Press Enter to commit or Escape to cancel.
  • Select: tick the checkboxes, or use the header checkbox to select every row.
  • Navigate: click a cell, then move with the arrow keys. The full key map is in Keyboard navigation and accessibility.
  • Resize and reorder: drag a header edge to resize, or drag a header to move the column.

5. Update the data#

Keep a reference to the grid API and change rows without rebuilding the grid:

TypeScript
grid.applyTransaction({
  add: [{ id: 'SO-10427', customer: 'Proseware Inc', region: 'EMEA', placedAt: '2026-11-08', status: 'open', total: 1330 }],
  update: [{ ...orders[0], status: 'shipped' }],
  remove: ['SO-10423'],
});

Rows are matched by the id from getRowId, so only the rows that changed are updated and selection stays with the same rows. See Updating data.

Next steps#

↑ ↓ to move, Enter to open, Esc to close