AdaptTable for Mantine

Spreadsheet formulas in Mantine

A formula column is a column nobody wrote code for: type =ROUND(budget * 0.15, 0) and the table computes it per row, sorts it, filters it and exports it like any other column.

The engine covers arithmetic, comparison, string joins, IF, and the aggregate functions a footer needs. A bad reference reports in the cell that caused it rather than blanking the table, and a circular reference reports #CYCLE! instead of recursing.

Formula columns serialize to the URL with everything else, so a derived column travels in the same link as the filters it sits beside.

The formula bar on this page is the host's own chrome, not the table's — the engine hands back column definitions, and Mantine renders the resulting columns exactly like the declared ones.

The code

import { DataTable } from "@adapttable/mantine";
import { buildFormulaColumns } from "@adapttable/core/formula";

const derived = buildFormulaColumns([
  {
    key: "margin",
    header: "Margin",
    formula: "=ROUND(budget * 0.15, 0)",
  },
  {
    key: "tag",
    header: "Tag",
    formula: '=UPPER(team) & " · " & role',
  },
]);

export function People({ rows, columns }) {
  return (
    <DataTable
      data={rows}
      columns={[...columns, ...derived]}
      rowKey={(row) => row.id}
    />
  );
}

Install

pnpm add @adapttable/mantine @adapttable/core @mantine/core @mantine/hooks

The same feature in the other kits

More Mantine features

Reference: formulas. More of this kit: AdaptTable for Mantine, or the live demo.