AdaptTable for ngx-bootstrap

Column management in ngx-bootstrap

Everything a user expects to do to a column, without writing a column-settings panel: rename, show and hide, reorder by drag, pin to either edge, resize by drag or keyboard, and switch row density.

Pinning is logical rather than physical, so a column pinned to the start stays on the correct side in a right-to-left layout.

The arrangement is state like any other: persist it to the URL, to localStorage, or to your own server through columnLayout and onColumnLayoutChange.

The code

import { Component, input, signal } from "@angular/core";
import type { ColumnDef, ColumnLayoutState } from "@adapttable/angular";
import { AdaptDataTable } from "@adapttable/ngx-bootstrap";
import { columnMenu } from "@adapttable/ngx-bootstrap/column-menu";
import { resizableColumns } from "@adapttable/ngx-bootstrap/resizable-columns";

@Component({
  selector: "app-people",
  imports: [AdaptDataTable],
  template: `
    <adapt-data-table
      [data]="rows()" [columns]="columns()" [rowKey]="rowKey"
      [features]="features" [columnLayout]="layout()"
      (columnLayoutChange)="layout.set($event)"
    />
  `,
})
export class People {
  readonly rows = input.required<readonly Person[]>();
  readonly columns = input.required<readonly ColumnDef<Person>[]>();
  readonly rowKey = (row: Person) => row.id;
  readonly layout = signal<ColumnLayoutState>({
    hidden: [], order: [], widths: {}, pinned: { name: "start" },
  });
  readonly features = [columnMenu(), resizableColumns()];
}

Install

# Follow the kit setup guide for compatible peers
pnpm add @adapttable/ngx-bootstrap @adapttable/angular ngx-bootstrap@22.0.0 @angular/forms@^22 rxjs@^7.4.0

The same feature in the other kits

More ngx-bootstrap features

Reference: column-management, columns. More of this kit: AdaptTable for ngx-bootstrap, or the live demo.