Skip to content

Conversation

Mr-KRAMA
Copy link
Contributor

This PR addresses a long-standing community request for documentation on how to wrap existing Angular Material components to create reusable custom components.

Problem
Developers frequently struggle with creating custom components that wrap Material components like mat-select and mat-input while maintaining form integration, validation, and Material Design features. This has been a pain point for 4+ years (see issue #21371).

Solution
Added a comprehensive guide with practical examples showing how to:
Wrap mat-select with predefined options

Create formatted input components (phone number example)

Handle async data loading with autocomplete

Implement proper ControlValueAccessor patterns

Support form validation and accessibility

What's included
Documentation : New guide at guides/creating-reusable-material-components.md

Working examples : Permission select and phone input components

Best practices : Testing, validation, and accessibility patterns

Real-world patterns : Covers the exact scenarios developers requested

Testing
✅ Linting passes

✅ Files properly formatted

✅ Examples follow Angular Material patterns

Impact
This guide will help thousands of Angular developers who currently struggle with component composition patterns. The examples are copy-paste ready and follow official Angular standards.

Closes #21371

@Mr-KRAMA Mr-KRAMA requested a review from a team as a code owner September 30, 2025 14:44
@Mr-KRAMA Mr-KRAMA requested review from crisbeto and tjshiu and removed request for a team September 30, 2025 14:44
@Mr-KRAMA Mr-KRAMA force-pushed the docs/custom-form-controls-guide branch from b8cc756 to 97ea4b3 Compare September 30, 2025 14:48
@crisbeto
Copy link
Member

crisbeto commented Oct 2, 2025

Closing this as another example of AI slop.

@crisbeto crisbeto closed this Oct 2, 2025
@Mr-KRAMA Mr-KRAMA deleted the docs/custom-form-controls-guide branch October 3, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs-feat(forms): Add guide on how to create custom components from existing material components
2 participants