fa-react-icon

🍺 Hi there, font-awesome icons for react lovers <3, Thanks...

Usage no npm install needed!

<script type="module">
  import faReactIcon from 'https://cdn.skypack.dev/fa-react-icon';
</script>

README

fa-react-icon

🍺 Hi there, font-awesome icons for react lovers <3, Thanks...

Installation

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";

Usage

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;

Note

react-fontawesome

  • 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.

Author

Ajay Marathe

Copyright and License

Copyright 2019 Ajay Marathe. Code released under the MIT license.