Skip to content

Set Up with React

When using Font Awesome with React, we recommend using our official react-fontawesome component to make everything work just right.

We’ll cover the basics of installing core utility packages, icon installation, and installing the React component, so that you can make awesome stuff your way!

First things first. Let’s install the react-fontawesome component into your project.

Terminal window
npm i --save @fortawesome/react-fontawesome@latest

Next you’ll need to use npm or yarn to install the core package which is a dependency that includes all the utilities to make the icons work.

Terminal window
npm i --save @fortawesome/fontawesome-svg-core

Lastly, you’ll need to install the icons you want to use. There are two ways to add Font Awesome icons to your project:

This is the simplest way to get started. It is also the only way to use Pro+ icons via a package manager.

Before installing your Kit package, you must complete the following steps:

  1. Set up a Kit
  2. Enable Package Installation for that Kit
  3. Configure access to your Kit’s package

Once you’ve completed both steps above, install your Kit package:

Terminal window
npm i --save @fortawesome/kit-[your-kit-code]

Alternatively, you can install individual Free or Pro icon packages for each style you want to use.

Free icons can be installed without any additional configuration and include the following styles.

Terminal window
npm i --save @fortawesome/free-solid-svg-icons
npm i --save @fortawesome/free-regular-svg-icons
npm i --save @fortawesome/free-brands-svg-icons

Pro icons require an active subscription to a Pro Plan. You’ll also need to configure access to these Pro Packages before you can install and use them.

After configuration is complete, you can install individual styles as packages:

Terminal window
npm i --save @fortawesome/pro-solid-svg-icons
npm i --save @fortawesome/pro-regular-svg-icons
npm i --save @fortawesome/pro-light-svg-icons
npm i --save @fortawesome/pro-thin-svg-icons
npm i --save @fortawesome/pro-duotone-svg-icons
npm i --save @fortawesome/duotone-regular-svg-icons
npm i --save @fortawesome/duotone-light-svg-icons
npm i --save @fortawesome/duotone-thin-svg-icons
npm i --save @fortawesome/sharp-solid-svg-icons
npm i --save @fortawesome/sharp-regular-svg-icons
npm i --save @fortawesome/sharp-light-svg-icons
npm i --save @fortawesome/sharp-thin-svg-icons
npm i --save @fortawesome/sharp-duotone-solid-svg-icons
npm i --save @fortawesome/sharp-duotone-regular-svg-icons
npm i --save @fortawesome/sharp-duotone-light-svg-icons
npm i --save @fortawesome/sharp-duotone-thin-svg-icons

Like Anakin said, it’s woooorking! All of our icons are now ready to do your project’s bidding. Learn how to add them to your React project and then use their power to bring order and style to your UI!