AdaptTable for Angular Aria

CSV export in Angular Aria

Compose exportCsv() and an export button joins the toolbar. It writes the page on screen as it stands — sorted, filtered and searched — to a CSV file the browser downloads.

A column's exportValue decides what the file gets, so a cell that shows a formatted date range exports the plain start date a spreadsheet sorts.

The code

import { Component, input } from "@angular/core";
import type { ColumnDef } from "@adapttable/angular";
import { AdaptDataTable } from "@adapttable/angular-aria";
import { exportCsv } from "@adapttable/angular-aria/export";

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"
      [features]="features"
    />
  `,
})
export class People {
  readonly rows = input.required<readonly Person[]>();
  readonly columns = columns;
  readonly rowKey = (row: Person) => row.id;
  readonly features = [exportCsv()];
}

Install

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

The same feature in the other kits

More Angular Aria features

Reference: exporting, export-pdf. More of this kit: AdaptTable for Angular Aria, or the live demo.