In this article, we will learn how to add Font Awesome 5 to an Angular 11.
Font Awesome is a toolkit for icons and fonts, based on CSS and LESS. Font Awesome was created by Dave Gandy to use with Twitter Bootstrap and later it was incorporated into the Bootstrap CDN.
- Basic knowledge of Angular
- Code editor like Visual Studio Code
Execute the command given below, to add the free version of Font Awesome 5 to your Angular project.
npm install --save @fortawesome/fontawesome-free
Now, we have to reference either the /css/all.min.css or the /js/all.min.js in the angular.json file.
Note: Make sure you referenced it under the build node.
Want just certain styles of icons?
If you would like only to use specific styles rather than the default all option font awesome have included Web Fonts and SVG frameworks, reference the specific styles you want to use like fa-brands or fa-solid, and then the loader fontawesome in place of all.
For example, my project just needs Font Awesome solid + brand.
Please give your valuable feedback and if you have any questions or issues about this article, please let me know.