--- name: angular-material-developer description: Generates Angular Material code and guidance for Angular projects using `@angular/material` with the Material 3 (M3) theming system. Covers installation, Sass-based theming via `mat.theme()` and the prebuilt palettes, density and typography customisation, component usage across all categories (form controls, buttons, overlays, layout, data display, navigation), `@angular/cdk` primitives (Overlay, Portal, Drag-Drop, Virtual Scroll, A11y), ReactiveForms / Signal Forms integration via `mat-form-field`, accessibility, and the M2 → M3 migration. Use when the user mentions Angular Material, `@angular/material`, `mat-*` components, M3 / Material 3, design tokens, OR when the Angular project's `package.json` contains `@angular/material`. Pairs with `angular-developer` for Angular fundamentals. license: MIT metadata: author: Mofiro Jean version: '0.0.1' --- # Angular Material Developer Guidelines > **Pairs with `angular-developer`** , that skill provides Angular fundamentals (signals, DI, routing, forms, SSR, accessibility). This skill focuses on Angular Material specifics. Install both for the best experience. ## Compatibility - **Tracks:** `@angular/material@22.2.4` (Angular v22), paired with `@angular/cdk@22.2.4` (Material peers an **exact** cdk version, keep the two pinned together). The v21-aligned line remains at `21.2.x` for legacy projects. - **Animations peer dropped (v21.2+):** Material no longer declares an `@angular/animations` peer dependency and animates via native CSS. `ng add @angular/material` on 21.2+/22 does **not** wire `provideAnimationsAsync()` and does not require `@angular/animations`, do not add either to a fresh Material 22 app. (Earlier v21.x and all v18-20 apps still need the provider; see [setup.md](references/setup.md).) - **Works for:** Material v19 → v22 projects (M3 theming system landed in v19; older majors used M2 with the now-legacy `mat.define-light-theme` / `mat.define-dark-theme` API). - **Angular:** v19 or newer required. v22 requires Node 22 or 26 and TypeScript 6. The skill assumes standalone components, control flow (`@if` / `@for`), and signal-based APIs. - **Sass:** required for theming. The build pipeline must support `.scss` (Angular CLI does by default). Standalone CSS-only theming is not supported by Material's theming engine. - **Not supported:** Material v18 and below (M2-only with `mat.define-*-theme()` API), Angular v18 or below (NgModule patterns + older animations API). ### v22.2 highlights (from 22.1) Additive minor, no breaking changes. Peers are unchanged (`@angular/core`, `forms`, `common`, `platform-browser` `^22.0.0 || ^23.0.0`). - **`MatIcon` auto Material Symbols class (22.2.0):** when only the Material Symbols font is loaded, `` adds the `material-symbols-*` class itself, so `setDefaultFontSetClass(...)` is no longer needed for the single-font case. If both legacy Material Icons and Symbols are loaded, the old behaviour applies. - **`MatMenuItem` `disabledInteractive` (22.2.0):** disabled styling that stays focusable and hoverable, so a tooltip can explain why the item is disabled. - **`MatFormFieldControl` supports Signal Forms (22.2.0)** and the datepicker reports parse errors under Signal Forms (22.2.4). - **CDK overlay `disposeOnNavigation: 'url-change'` (22.2.1):** opt in to closing on any URL change, not just back/forward. - **Patch fixes worth knowing:** CDK a11y treats `inert` elements as non-focusable (22.2.3), chips get a touch target (22.2.3), `mat-icon` no longer copies event attributes (22.2.2). ### v22 breaking changes (from v21) The v21 → v22 jump has real API drift, not just an Angular version bump. Watch for: - **Combobox:** legacy combobox and autocomplete promoted / removed. `SimpleCombobox` promoted to `Combobox` with all `simpleCombobox*` symbols renamed to `combobox*`. - **List:** `MatListOption.checkboxPosition` removed, use `togglePosition` instead. `MatListOptionCheckboxPosition` renamed to `MatListOptionTogglePosition`. - **CDK:** `injector` parameter is now required on `ConfigurableFocusTrap` and `FocusTrap` constructors. `ConfigurableFocusTrapFactory.create` boolean parameter replaced with a config object. `DropListRef.drop` event parameter is now required. `ContextMenuTracker` renamed to `MenuTracker`. Removed: `CDK_DESCRIBEDBY_HOST_ATTRIBUTE`, `CDK_DESCRIBEDBY_ID_PREFIX`, `MESSAGES_CONTAINER_ID`. - **Multiple components:** input/model rename from `values` to `value` across Combobox, Listbox, Tree, Menu, Toolbar, Select. Constructors with rest arguments removed (affects code that extends Material or CDK components). - **Dialog / Overlay:** `ArrowViewState` and `ArrowViewStateTransition` types removed. Most of these have automatic `ng update` migrations. When in doubt, run `ng update @angular/material` and let the schematic do the work before hand-editing. ### v22 new features worth knowing - **Signal Forms stable** (was experimental in v21). Angular's signal-based form API is now safe to use in production. `mat-form-field` composes with both `ReactiveFormsModule` and Signal Forms. - **Angular Aria stable** (was preview). New accessibility primitives ship in the framework, which reduces the need to reach for CDK's a11y module for some patterns. - **Button progress indicator** support inside `