AdaptTable for Ant Design

Inline cell editing in Ant Design

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

Text and number both edit in an antd Input rather than an InputNumber — one control, one commit path — while a select column edits in antd's Select and a multi-select in the same Select in multiple mode.

The code

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

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/antd @adapttable/core antd

The same feature in the other kits

More Ant Design features

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