Sometimes, we want to host Material Icons offline with JavaScript.
In this article, we’ll look at how to host Material Icons offline with JavaScript.
How to host Material Icons offline with JavaScript?
To host Material Icons offline with JavaScript, we can install the material-design-icons
package.
To install it, we run
npm install material-design-icons --save
Then we import it in our CSS file with
@import '~material-design-icons/iconfont/material-icons.css';
And then we use it by writing
<i class="material-icons">face</i>
in our HTML code.
Conclusion
To host Material Icons offline with JavaScript, we can install the material-design-icons
package.