Angular CDK

Unstyled, accessible building blocks for authoring custom Angular components: overlays, drag-and-drop, focus/a11y utilities, virtual scrolling, and more.

Library
npm
v22.1.5
25,045stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
97/100Excellent
Development Activity96
Maintenance96
Community96
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
90/100Excellent
Architecture92
Code Quality90
Innovation88
Learning Curve90

The Angular Component Dev Kit (CDK) is the behavior layer underneath Angular Material, published as a standalone package so any Angular app can build its own custom components on the same primitives Google’s Material team uses. Rather than shipping styled widgets, it ships composable, unstyled building blocks — overlay positioning, drag-and-drop, focus trapping, live-region announcements, virtual scrolling, and a text-field autosize directive — each as its own entry point you import only where you need it.

A distinguishing feature is the CDK’s component test harness system: a ComponentHarness API that lets you write tests against a component’s public behavior once and run them unchanged under TestBed, Protractor, or Selenium WebDriver, so tests survive internal DOM refactors. Combined with first-class accessibility services (LiveAnnouncer, InteractivityChecker, high-contrast-mode detection) that are usable independent of any specific component, the CDK functions less like a widget library and more like an accessibility- and interaction-pattern toolkit for the whole Angular ecosystem.

What You Get

  • An overlay engine (OverlayRef, OverlayPositionBuilder) for building popups, tooltips, dropdowns, and dialogs with flexible connected/global positioning and scroll strategies
  • A drag-and-drop module (CdkDrag, CdkDropList) with sorting, boundary constraints, and free-drag support, usable without any other CDK or Material component
  • Accessibility services — FocusTrap, FocusMonitor, LiveAnnouncer, InteractivityChecker, and high-contrast-mode detection — that work as standalone injectable services
  • A virtual scrolling viewport (CdkVirtualScrollViewport) for rendering large lists efficiently by only mounting visible items
  • A component test harness framework (ComponentHarness) that decouples tests from DOM structure and runs identically across TestBed, Protractor, and Selenium WebDriver
  • Low-level utilities for bidirectional text (Directionality), platform detection, keycodes, and coercion helpers used throughout the Angular ecosystem

Common Use Cases

  • Building a custom dropdown, tooltip, or modal dialog with precise positioning without adopting Material’s visual design
  • Adding accessible drag-and-drop reordering to a list, kanban board, or file uploader
  • Rendering a virtualized table or list with thousands of rows without a perceptible scroll-jank penalty
  • Writing component tests that assert on behavior (open/close, selected value) rather than brittle CSS selectors, portable across test runners
  • Implementing WAI-ARIA-compliant focus management and screen-reader announcements in a fully custom design system

Under The Hood

Architecture The CDK is organized as roughly twenty independent entry-point modules under src/cdk/ (a11y, overlay, drag-drop, portal, scrolling, table, tree, listbox, menu, dialog, stepper, layout, observers, platform, testing, bidi, clipboard, coercion, collections, config, keycodes, text-field), each with its own public-api.ts boundary and NgModule, so consumers pull in only the primitives they need rather than the whole package. The overlay subsystem (overlay.ts, overlay-ref.ts, position/overlay-position-builder.ts, keyboard/outside-click dispatchers) is the clearest example of layered design: a factory function resolves dependencies via Angular’s injector, delegates rendering to a swappable OverlayContainer, and exposes a OverlayRef handle that owns its own lifecycle independent of the component that created it. The testing harness layer (harness-environment.ts plus protractor/, selenium-webdriver/, and testbed/ adapters) inverts the usual test-framework relationship by defining a single environment-agnostic contract that each runner implements, which is what lets the same harness-based test execute unchanged in unit and e2e contexts.

Tech Stack Written almost entirely in TypeScript (roughly four-fifths of the codebase) against Angular’s own APIs (@angular/core, @angular/common, @angular/forms, @angular/platform-browser as peer dependencies, versioned via the monorepo’s pnpm catalog), with SCSS powering the handful of prebuilt style sheets (overlay, a11y, text-field) that ship as opt-in CSS. The monorepo is built with Bazel (BUILD.bazel files throughout, MODULE.bazel for the newer bzlmod setup) alongside a pnpm workspace, with ts-node-driven scripts orchestrating package builds, API-golden checks, and circular-dependency verification outside of Bazel itself. Runtime dependencies are deliberately minimal — tslib and parse5 — keeping the CDK lightweight relative to the tooling used to build it.

Code Quality Testing relies on Jasmine and Karma, with spec files colocated next to their implementation (roughly one spec file for every five source files, concentrated in the more behaviorally complex modules like overlay, drag-drop, and a11y) and exercised across a wide CI surface — dedicated GitHub Actions workflows for standard CI, scheduled CI, and internal Google test suites, plus separate linting via tslint, stylelint, and a Prettier-based formatter invoked through the team’s own ng-dev CLI. Every source file carries a license header and the public surface is guarded by an API-golden-file check (approve-api-golden.mts) that fails CI on unreviewed public API changes, reflecting the discipline expected of a library embedded in Angular’s own release train.

What Makes It Unique The CDK’s defining idea is separating interaction-pattern behavior from presentation entirely — most UI libraries bundle both, but the CDK ships only the former (positioning math, focus management, drag physics, virtualization) as framework-integrated primitives, letting Angular Material be just one opinionated skin on top of it. Its test harness architecture is a genuine point of differentiation among component libraries: rather than one test API per test runner, a single harness definition per component runs unchanged across unit tests (TestBed) and end-to-end tests (Protractor, Selenium WebDriver), which most comparable UI toolkits do not offer.

Used by 12 apps in this directory

TypeScript
76%
AGPL 3.0

Ghostfolio

Invoicing Finance

9,252

Track your stocks, ETFs, and crypto with a privacy-first, self-hostable wealth management platform built for data-driven investors.

View details
93
Repo Health
79
Technical
67
Dependency
Built with
TypeScript76%
HTML21%
Updated yesterday
TypeScript
76%
AGPL 3.0

Ghostfolio

Invoicing Finance

9,252

Track your stocks, ETFs, and crypto with a privacy-first, self-hostable wealth management platform built for data-driven investors.

View details
93
Repo Health
79
Technical
67
Dependency
Built with
TypeScript76%
HTML21%
Updated yesterday
Ruby
79%
GPL 3.0

OpenProject

Project Management · Productivity · Collaboration

16,035

The open source project management platform that unifies Gantt charts, agile boards, time tracking, and team collaboration under full self-hosted control.

View details
96
Repo Health
79
Technical
69
Dependency
Built with
Ruby79%
TypeScript12%
Updated yesterday
Python
62%
GPL 3.0

Paperless-ngx

Bookmarks Archiving

44,898

Turn your paper pile into a searchable digital archive with OCR, AI classification, and automated workflows — all running on your own server.

View details
91
Repo Health
88
Technical
67
Dependency
Built with
Python62%
TypeScript30%
Updated today
TypeScript
91%
AGPL 3.0

PeerTube

Social Media

15,316

A federated, ActivityPub-based video hosting platform built by Framasoft — self-hostable instances interconnect into a network with no vendor lock-in, P2P-assisted streaming, and no ads.

View details
95
Repo Health
75
Technical
70
Dependency
Built with
TypeScript91%
Updated 1 weeks ago
TypeScript
91%
MIT

Super Productivity

Productivity · Project Management

21,845

A privacy-respecting, local-first task manager with built-in timeboxing, Pomodoro timer, and deep integrations for Jira, GitHub, GitLab, and CalDAV — no accounts, no data collection, ever.

View details
90
Repo Health
81
Technical
72
Dependency
Built with
TypeScript91%
Updated 2 days ago
TypeScript
91%
MIT

Super Productivity

Productivity · Project Management

21,845

A privacy-respecting, local-first task manager with built-in timeboxing, Pomodoro timer, and deep integrations for Jira, GitHub, GitLab, and CalDAV — no accounts, no data collection, ever.

View details
90
Repo Health
81
Technical
72
Dependency
Built with
TypeScript91%
Updated 2 days ago
TypeScript
79%
AGPL 3.0

VoidAuth

Security · Authentication

2,488

Self-hosted SSO with OIDC, LDAP, passkeys, and proxy auth for your entire self-hosted stack

View details
82
Repo Health
77
Technical
73
Dependency
Built with
TypeScript79%
HTML15%
Updated yesterday
TypeScript
79%
AGPL 3.0

VoidAuth

Security · Authentication

2,488

Self-hosted SSO with OIDC, LDAP, passkeys, and proxy auth for your entire self-hosted stack

View details
82
Repo Health
77
Technical
73
Dependency
Built with
TypeScript79%
HTML15%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search