🍺 Font Awesome Icons for React Lovers. Coded by Bootcatch.
Using NPM:
npm i fa-react-icon
npm i font-awesome
import fontawesome css in your main file i.e index.js
import React from 'react';
import ReactDOM from 'react-dom';
//fontawesome css
import "font-awesome/css/font-awesome.min.css";
Import it where you want use ReactFontawesome Icon //I'm using in my home.js file
import React, { Component } from 'react';
//import here ReactFontawesome component
import ReactFontawesome from "fa-react-icon";
class Home extends Component {
constructor(props) {
super(props);
this.state = { }
}
render() {
return (
<div>
//use wherever you want
<ReactFontawesome icon="file" size="4" color="orange"></ReactFontawesome>
</div>
);
}
}
export default Home;
- add only name to icon, e.g
icon="file"
- no need to add full name like e.g
icon="fa fa-file"
- icon - font-awesome icon name will find here here
- size - icon size in
rem
. - color - you can give any valid value
e.g red, yellow, #fffff, #ff0000.
Ajay Marathe
Copyright 2019 Ajay Marathe. Code released under the MIT license.