Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reference Google Material-Design-Icons after npm install?

So after doing npm install material-design-icons, how do I use them in my React application?

The methods included here doesn't include the npm method.

like image 405
hackerl33t Avatar asked Jun 05 '18 04:06

hackerl33t


People also ask

How do I use the Google material icon?

Using the Icon Google's Material Icons provides a long list of icons. Choose any one of them and add the name of the icon class to any HTML element within the < body > tag. In the following example, we have used the icon named accessibility that belongs to the action category.

How do I add material design icons in HTML?

To embed Google Icons in your HTML web pages you have to add the link of material-icons font library in the <head> section of your HTML file and then add the class material-icons in the <i> or <span> tag of the <body> section along with the name of the icon.


1 Answers

This is the way you can reference it (in your styles.css):

@import '~material-design-icons/iconfont/material-icons.css';

To use it:

<i class="material-icons">cloud_upload</i>
like image 104
YJBeetle Avatar answered Sep 23 '22 03:09

YJBeetle