Setting up Font-awesome 6 Alpha

Setting up Font-awesome 6 Alpha

Recently I needed JavaScript Icon on a webpage, so I checked font awesome 4.7.0, the version I've been using for a while but couldn't find JavaScript icon. I then Learnt that Font Awesome 6 Alpha is out and decided to check it out, as expected I saw JavaScript icon and some other new icons that weren't in version 4.7.0.

We'll be using NPM to install font awesome 6 package, you need node.js installed, you can check setting up node.js on how to do this.

To install the package, in your terminal you'll have to type

npm install --save @fortawesome/fontawesome-free

And you should have Font awesome installed, So now you need to use script tag to link Three files in your HTML file so you can use font awesome icons.

brands.js, fontawesome.js and fontawesome.css

Which are all inside your node_modules file.

  <script defer src="/node_modules/@fortawesome/fontawesome-free/js/brands.js"></script>
  <script defer src="/node_modules/@fortawesome/fontawesome-free/js/fontawesome.js"></script>
  <script defer src="/node_modules/@fortawesome/fontawesome-free/css/fontawesome.css"></script>

They should all be inside the head tag, Now i can use the javascript font.

<i class="fab fa-js"></i>

download.png

Check package manager for full documentation.

Your Feedback is warmly welcomed

Thanks for reading !.