AdaptTable for ng-bootstrap

Inline cell editing in ng-bootstrap

Mark a column editable, compose editing(onCellEdit), and double-click opens a ng-bootstrap editor in the cell — text, number, date or select. Enter commits, Escape cancels.

The table never mutates your rows. It hands your handler the row, the column key and the new value, and a column's validate refuses a value before it reaches you: clear a name and try to commit it.

With cellNavigation() composed, the arrow keys move a visible focus from cell to cell.

The code

import { Component, input } from "@angular/core";
import type { ColumnDef } from "@adapttable/angular";
import { AdaptDataTable } from "@adapttable/ng-bootstrap";
import { cellNavigation } from "@adapttable/ng-bootstrap/cell-navigation";
import { editing } from "@adapttable/ng-bootstrap/editing";

const columns: ColumnDef<Person>[] = [
  {
    key: "name",
    editable: true,
    editor: "text",
    validate: (value) => (String(value).trim() ? undefined : "Required"),
  },
  { key: "budget", editable: true, editor: "number" },
  {
    key: "status",
    editable: true,
    editor: { type: "select", options: ["Active", "Planned", "Blocked"] },
  },
];

@Component({
  selector: "app-people",
  imports: [AdaptDataTable],
  template: `
    <adapt-data-table
      [data]="rows()"
      [columns]="columns"
      [rowKey]="rowKey"
      [features]="features"
    />
  `,
})
export class People {
  readonly rows = input.required<readonly Person[]>();
  readonly columns = columns;
  readonly rowKey = (row: Person) => row.id;
  readonly save =
    input.required<(row: Person, key: string, value: unknown) => void>();
  readonly features = [
    editing<Person>((row, key, value) => this.save()(row, key, value)),
    cellNavigation(),
  ];
}

Install

# Follow the kit setup guide for compatible peers
pnpm add @adapttable/ng-bootstrap @adapttable/angular @ng-bootstrap/ng-bootstrap@21.0.0 @popperjs/core@2.11.8 @angular/forms@^22 @angular/localize@^22 rxjs@^7.4.0

The same feature in the other kits

More ng-bootstrap features

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