Open In App

Adding Angular Material Component to Angular Application

Angular Material provides Design Components for Angular. This is build and maintained by Angular Team. This provides the Angular developers with common UI components and tools to help build their own custom components. We as a user can integrate this with our Angular Application using the npm packages provided by them. 
Angular Material also provides CDK in order to integrate common Interaction patterns.

 
Lists of Some Components provided is:  



  1. Form Control
  2. Navigation
  3. Layout
  4. Button and Indicators
  5. Data Table
  6. Popups
  7. Modals

STEPS TO ADD MATERIAL COMPONENT TO YOUR APPLICATION:

npm install --save angular-material
npm install --save @angular/cdk
npm install --save angular-material@version
npm install --save @angular/cdk@version
ng serve

EXAMPLE OF ADDING CARD COMPONENT TO YOUR ANGULAR PROJECT: 
 



ng new GfGMaterialCardExample
cd GfGMaterialCardExample
npm install --save angular-material@8.0.0
npm install --save @angular/cdk@^8.2.3

 Geeks For Geeks - Angular Material Card Example 
mat-card {
    color: green;
    border:1px solid black;
}

Article Tags :