AdaptTable for Base UI

Inline cell editing in Base UI

Mark a column editable, pass onCellEdit, and double-click opens a Base UI 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.

The editors are Base UI's Input, Select and Checkbox; because Base UI does not forward a ref to the inner input, the cell finds the focusable node itself when the editor mounts.

The code

import { DataTable } from "@adapttable/base-ui";

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/base-ui @adapttable/core @base-ui/react

The same feature in the other kits

More Base UI features

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