Import only used material (and custom) icons in Angular
Installation
npm i mat-icon-import#or yarn add mat-icon-import
Usage
At first download the icons you need from here in SVG 24px format (default). The icon names are of type baseline-[key]-24px.svg
. You will have to use the key
when importing this lib.
Import the IconImportModule
in your application module and call the forRoot()
function with two parameters. At first the array of icon keys, e.g. (account_circle, add or whatever you want). The secont parameter is the path where you store the icons in your assets folder.
;
Register the icons where you need them. E.g. in the AppComponent
to make it available in the complete application.
;
Use the registered icons with
Don't forget to include the MatIconModule
from @angular/material
.
Get in contact
- Check the authors website
- Get in touch via twitter or facebook