How to use Material Icons with React

Here, I will show you how to use material icons in your react app. First of all, you need to install two packages.


npm install @material-ui/core

npm install @material-ui/icons

Now it’s the time for you to select an icon from here.

I have given below an example of using AccessAlarmIcon from the list. You can add your custom CSS for the icons by using style attributes.

import React from 'react';
import AccessAlarmIcon from '@material-ui/icons/AccessAlarm';

function App() {
  return (
    <div>
     <AccessAlarmIcon style={{ color: '#848475', fontSize: '100px'}}/>
    </div>
  );
}

export default App;

Similar Posts

Leave a Reply