AdaptTable for Taiga UI

Row reordering in Taiga UI

Compose rowReorder from @adapttable/taiga-ui/row-reorder and a grip appears on every row. Drag it, or press Space to lift a row, the arrows to move it and Space to drop it; a live region announces each step.

The table never mutates your array: onRowReorder asks the host with the row's old and new positions and the row itself, and the host writes. This page applies each move with core's applyRowReorder and says what it did.

The code

import { Component, input, signal } from "@angular/core";
import { applyRowReorder } from "@adapttable/core";
import type { ColumnDef } from "@adapttable/angular";
import { AdaptDataTable } from "@adapttable/taiga-ui";
import { rowReorder } from "@adapttable/taiga-ui/row-reorder";

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]="order() ?? 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 order = signal<readonly Person[] | null>(null);
  readonly features = [
    rowReorder<Person>((from, to) =>
      this.order.set(applyRowReorder(this.order() ?? this.rows(), from, to))
    ),
  ];
}

Install

# Follow the kit setup guide for compatible peers
pnpm add @adapttable/taiga-ui @adapttable/angular @taiga-ui/core@5.26.0 @taiga-ui/kit@5.26.0 @taiga-ui/cdk@5.26.0 @taiga-ui/i18n@5.26.0 @taiga-ui/styles@5.26.0 @taiga-ui/icons@5.26.0 @taiga-ui/event-plugins@^5 @taiga-ui/design-tokens@~0.320.0 @angular/cdk@^22 @angular/forms@^22 @angular/router@^22 rxjs@^7.8.2

The same feature in the other kits

More Taiga UI features

Reference: row-reordering. More of this kit: AdaptTable for Taiga UI, or the live demo.