AdaptTable for MUI

Inline cell editing in MUI

Mark a column editable, pass onCellEdit, and double-click opens a MUI editor in the cell. Enter commits, Escape cancels, Tab moves to the next editable cell.

The table never mutates your rows. It hands your handler the row, the column and the new value, and shows whatever you hand back — which is what makes optimistic updates, validation and rollback yours to decide.

With cellNavigation on, the same handler receives whole blocks: paste a spreadsheet range with Ctrl+V, drag the fill handle, and undo the entire paste with one Ctrl+Z.

Every editor is a small TextField — text, number and the select variant with MenuItem options — so a rejected value reports through the field's own error state and helperText rather than through chrome bolted beside it.

The code

import { DataTable } from "@adapttable/mui";

const columns = [
  { key: "name", editable: true },
  {
    key: "status",
    editable: true,
    editor: { type: "select", options: ["active", "on-leave"] },
  },
  { key: "budget", editable: true, editor: "number" },
];

export function People({ rows, onSave }) {
  return (
    <DataTable
      data={rows}
      columns={columns}
      rowKey={(row) => row.id}
      cellNavigation
      editHistory
      onCellEdit={(row, key, value) =>
        onSave({ ...row, [key]: value })
      }
    />
  );
}

Install

pnpm add @adapttable/mui @adapttable/core @mui/material

The same feature in the other kits

More MUI features

Reference: cell-editing, cell-navigation. More of this kit: AdaptTable for MUI, or the live demo.