What is the CDK?
The CDK is a collection of well-tested tools that help you build custom components with:- Accessibility: Built-in support for screen readers, keyboard navigation, and focus management
- Portability: Create reusable components that work across different contexts
- Flexibility: No opinionated styles - bring your own design system
- Performance: Optimized for production applications
Installation
Categories
The CDK is organized into three main categories:Common Behaviors
Utilities for implementing common interaction patterns:- Accessibility (a11y) - Focus management, live announcements, high contrast detection
- Bidirectionality (bidi) - LTR/RTL layout support
- Clipboard - Copy text to clipboard
- Drag and Drop - Sortable lists and free dragging
- Layout - Responsive breakpoint detection
- Observers - Observe DOM changes
- Overlay - Floating panels and popovers
- Platform - Browser and device detection
- Portal - Dynamically render content
- Scrolling - Virtual scrolling and scroll detection
- Text Field - Auto-resizing textareas
Components
Unstyled component primitives:- Accordion - Expandable panels
- Dialog - Modal dialogs
- Listbox - Accessible listbox pattern
- Menu - Context menus and menu bars
- Stepper - Step-by-step workflows
- Table - Data tables with sorting and pagination
- Tree - Hierarchical tree structures
Utilities
Helper functions and tools:- Coercion - Type conversion utilities
- Collections - Data source abstractions
- Keycodes - Keyboard key constants
- Testing - Component test harnesses
Design Philosophy
The CDK is designed to be:- Composable: Mix and match behaviors to create custom components
- Tree-shakeable: Only bundle what you use
- Framework-agnostic patterns: While built for Angular, the concepts apply broadly
- Production-ready: Used by Angular Material and thousands of applications