Open In App

How to use font-awesome icons from Node.js-modules?

Font-awesome is a web’s icon library that gives you scalable vector icons that can be customized in terms of color, size, and in many more aspects. Many companies integrate this library icon’s on their websites. It has 600+ icons and every icon is mobile and desktop responsive irrespective of the resolution screen size. It also gives us to use animations without the use of javascript.

Syntax for Installing the library:



npm install font-awesome --save

Implementation of code:



In style.css file, import font-awesome by using the following syntax.




@import url('../node_modules/font-awesome/css/font-awesome.min.css');

app.component.html :




<h1>Font-awesome</h1>
Notification :
<i class='fas fa-bell' style='font-size:24px'></i>
<br><br>
Message or Inbox :
<i class='fas fa-envelope' style='font-size:24px'></i>
<br><br>
Bookmark : 
<i class='fas fa-bookmark' style='font-size:24px'></i>
<br><br>
Like Button :
<i class='fas fa-thumbs-up' style='font-size:24px'></i>
<br><br>
Calendar:
<i class='fas fa-calendar-alt' style='font-size:24px'></i>

Output:


Article Tags :