AdaptTable for Ant Design

Row selection in Ant Design

Tick rows one at a time or take the whole page from the header box. The selection is a set of ids rather than a slice of what is rendered, so a row chosen on page one is still chosen while page three is on screen.

Bulk actions run against that set, can ask for confirmation first, and report back through your own handler — the table never performs the write.

Selection is controllable: hand it selectedIds and onSelectionChange and it becomes state your app owns.

The row boxes come from antd's own rowSelection API rather than a column the adapter draws, so the part name lands inside the cell here; the bulk bar is an antd Alert banner with its action slot, which is antd's own batch-operation pattern.

The code

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

export function People({ rows, columns, onArchive }) {
  return (
    <DataTable
      data={rows}
      columns={columns}
      rowKey={(row) => row.id}
      bulkActions={[
        {
          key: "archive",
          label: "Archive",
          confirm: true,
          onAction: (ids) => onArchive(ids),
        },
      ]}
    />
  );
}

Install

pnpm add @adapttable/antd @adapttable/core antd

The same feature in the other kits

More Ant Design features

Reference: selection. More of this kit: AdaptTable for Ant Design, or the live demo.