AdaptTable for Angular Material

Row selection in Angular Material

Tick rows one at a time or take the whole page from the header box, then every matching row from the banner that offers it. 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 two is on screen.

Bulk actions run against that set and report back through your own handler — the table never performs the write. This page writes what each action received under the table.

The code

import { Component, input } from "@angular/core";
import type { ColumnDef } from "@adapttable/angular";
import { AdaptDataTable } from "@adapttable/angular-material";
import { bulkActions } from "@adapttable/angular-material/bulk-actions";

const columns: ColumnDef<Person>[] = [
  { key: "name", sortable: true },
  { key: "team" },
  { key: "budget", sortable: true },
];

@Component({
  selector: "app-people",
  imports: [AdaptDataTable],
  template: `
    <adapt-data-table
      [data]="rows()"
      [columns]="columns"
      [rowKey]="rowKey"
      [selectable]="true"
      [features]="features"
    />
  `,
})
export class People {
  readonly rows = input.required<readonly Person[]>();
  readonly columns = columns;
  readonly rowKey = (row: Person) => row.id;
  readonly archive = input.required<(ids: string[]) => void>();
  readonly features = [
    bulkActions([
      { key: "archive", label: "Archive", onClick: (ids) => this.archive()(ids) },
    ]),
  ];
}

Install

# Follow the kit setup guide for compatible peers
pnpm add @adapttable/angular-material @adapttable/angular @angular/material@22.2.1 @angular/cdk@22.2.1 @angular/forms@^22 rxjs@^7.8.0

The same feature in the other kits

More Angular Material features

Reference: selection. More of this kit: AdaptTable for Angular Material, or the live demo.