AdaptTable for Angular CDK

Filtering in Angular CDK

Declare what a column filters by and the table builds the form: text with its operators, number and date ranges, multi-select checkboxes and a yes/no choice, each using Angular CDK controls.

Filters opens as an anchored popover or as a drawer, with an AND/OR tree at the top for what one row of inputs cannot say. Header funnels filter one column in place, and every active filter shows as a chip that removes itself.

Filter state lives in the versioned URL, so a filtered view is a link someone can send.

The code

import { Component, input } from "@angular/core";
import type { ColumnDef } from "@adapttable/angular";
import { AdaptDataTable } from "@adapttable/angular-cdk";
import { filters } from "@adapttable/angular-cdk/filters";
import { headerFilters } from "@adapttable/angular-cdk/header-filters";

const columns: ColumnDef<Person>[] = [
  { key: "name", filter: "text" },
  { key: "team", filter: { type: "multiSelect", options: "auto" } },
  { key: "budget", filter: "numberRange" },
  { key: "hiredAt", filter: "dateRange" },
];

@Component({
  selector: "app-people",
  imports: [AdaptDataTable],
  template: `
    <adapt-data-table
      [data]="rows()"
      [columns]="columns"
      [rowKey]="rowKey"
      urlKey="f"
      filtersMode="popover"
      [features]="features"
    />
  `,
})
export class People {
  readonly rows = input.required<readonly Person[]>();
  readonly columns = columns;
  readonly rowKey = (row: Person) => row.id;
  readonly features = [filters([]), headerFilters()];
}

Install

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

The same feature in the other kits

More Angular CDK features

Reference: filtering, filter-tree, url-state. More of this kit: AdaptTable for Angular CDK, or the live demo.