
Angular Best Practices Material
- 397 installs
- 37 repo stars
- Updated March 28, 2026
- alfredoperez/angular-best-practices
angular-best-practices-material is an agent skill that guides correct Angular Material component usage, theming, accessibility, and layout patterns for developers who need enterprise-grade, design-system-aligned web UIs.
About
angular-best-practices-material is a Claude Code skill from alfredoperez/angular-best-practices that encodes Angular Material best practices for enterprise web UIs. It helps developers choose components, configure theming, meet accessibility requirements, and apply layout patterns that stay consistent with design system constraints. The skill is invoked during feature work when Material dialogs, tables, form fields, or navigation shells need correct API usage instead of ad hoc CSS overrides. Reach for it when an Angular team standardizes on Material and wants agents to generate or review UI code that matches internal design guidelines and WCAG expectations.
- Angular Material component patterns
- Theming and density guidance
- Accessibility-minded UI defaults
- Form and table best practices
- Consistent enterprise UI structure
Angular Best Practices Material by the numbers
- 397 all-time installs (skills.sh)
- Ranked #664 of 2,245 Frontend Development skills by installs in the Skillselion catalog
- Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/alfredoperez/angular-best-practices --skill angular-best-practices-materialAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 397 |
|---|---|
| repo stars | ★ 37 |
| Last updated | March 28, 2026 |
| Repository | alfredoperez/angular-best-practices ↗ |
How do you implement Angular Material theming correctly?
Implement Angular Material components, theming, accessibility, and layout patterns correctly when building enterprise web UIs with consistent design system constraints.
Who is it for?
Angular developers standardizing enterprise UIs on Angular Material who need consistent theming, accessibility, and layout guidance during implementation.
Skip if: Teams using React, Vue, or custom CSS design systems without Angular Material should skip this skill entirely.
When should I use this skill?
User asks to add, theme, or audit Angular Material components, CDK layouts, or accessibility in an Angular enterprise app.
What you get
Angular Material component implementations, theme configuration, accessible layout patterns, and design-system-aligned UI code snippets.
- Material component implementations
- Theme configuration
- Accessible layout patterns
Files
Angular Material Best Practices
Angular Material and CDK rules for component usage, theming, and testing. Use with the core angular-best-practices skill for comprehensive Angular coverage.
Links
When to Apply
- Importing and configuring Material components
- Setting up M3 theming with design tokens
- Using CDK utilities for overlays, drag-and-drop, or virtual scrolling
- Writing tests for Material components
Rules
| Rule | Impact | Description |
|---|---|---|
| Import Material Modules Selectively | MEDIUM | Tree-shake unused components with standalone imports |
| Use Angular Material Theming System | MEDIUM | M3 theme API with CSS custom properties |
| Use CDK Utilities Over Custom Implementations | MEDIUM | Battle-tested overlays, virtual scroll, and a11y primitives |
| Use Test Harnesses for Material Components | HIGH | Stable tests that survive internal DOM changes |
Install
Install from skills.sh/alfredoperez/angular-best-practices:
- Core skill: angular-best-practices
- This add-on: angular-best-practices-material
Angular Material Best Practices
Use with the core angular-best-practices skill.---
1. Angular Material
Impact: MEDIUM (UI components)
1.1 Import Angular Material Modules Selectively
Impact: MEDIUM (Reduces bundle size)
Import individual Material component modules (e.g., MatButtonModule) directly in standalone components instead of creating shared material modules. This enables tree-shaking of unused components.
Incorrect:
// shared-material.module.ts — imports everything, tree-shaking fails
@NgModule({ exports: [MatButtonModule, MatCardModule, MatTableModule, /* 30+ modules */] })Correct:
@Component({
imports: [MatButtonModule, MatIconModule], // Only what this component needs
})1.2 Use Angular Material Theming System
Impact: MEDIUM (Consistent design tokens)
Use Material's M3 theming API with mat.theme() to define colors, typography, and density. Create custom themes using CSS custom properties generated by the theme mixin.
Incorrect:
.mat-mdc-button { background: #1976d2; } /* Hardcoded — breaks dark mode */Correct:
@use '@angular/material' as mat;
html { @include mat.theme((color: (primary: mat.$azure-palette))); }1.3 Use CDK Utilities Over Custom Implementations
Impact: MEDIUM (Battle-tested, accessible primitives)
Use Angular CDK for overlays (Overlay), drag-and-drop (cdkDrag), virtual scrolling (cdkVirtualFor), clipboard (cdkCopyToClipboard), and accessibility (FocusTrap, LiveAnnouncer) instead of custom solutions.
Incorrect:
// Custom scroll handler — misses edge cases, no recycling
@HostListener('scroll') onScroll() { this.loadMore(); }Correct:
<cdk-virtual-scroll-viewport itemSize="48">
<div *cdkVirtualFor="let item of items">{{ item.name }}</div>
</cdk-virtual-scroll-viewport>1.4 Use Test Harnesses for Material Components
Impact: HIGH (Stable tests across Material versions)
Use Material's built-in test harnesses (MatSelectHarness, MatInputHarness, etc.) instead of querying DOM elements. Harnesses are maintained by the Angular team and survive internal DOM changes.
Incorrect:
const select = fixture.debugElement.query(By.css('.mat-mdc-select'));
select.nativeElement.click(); // Fragile — breaks on Material updatesCorrect:
const select = await loader.getHarness(MatSelectHarness.with({ selector: '#role' }));
await select.open();
await select.clickOptions({ text: 'Admin' });---
Related skills
FAQ
What does angular-best-practices-material cover?
angular-best-practices-material covers Angular Material component selection, theming setup, accessibility patterns, and layout conventions for enterprise web UIs that must follow a shared design system.
When should I use angular-best-practices-material?
Use angular-best-practices-material when building or reviewing Angular apps that standardize on Material and need correct component APIs, theme tokens, and accessible layouts instead of custom CSS workarounds.