VOOZH about

URL: https://docs-v6.fontawesome.com/web/use-with/react

⇱ Set Up with React | Font Awesome Docs Version 6


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 using the official react-fontawesome component (described below), which uses the SVG + JS method to render icons. But you can opt to use the Web Fonts + CSS method if you prefer.

Follow the steps below to set up the react-fontawesome component in your project.

First you’ll need to use npm or yarn to install the core package which includes all the utilities to make the icons work:

Terminal window
npmi--save@fortawesome/fontawesome-svg-core

Find out more about what’s in Font Awesome core

Next, you’ll install the icons you want to use — you can choose a Kit Package or SVG Icon Packages, and select any of our styles.

For Pro icons, you’ll first need to set up access with your secret Font Awesome npm token and global or per-project access.

Then add the Pro icon style packages that you plan to use in your app:

And lastly, install the Font Awesome React component:

Terminal window
npmi--save@fortawesome/react-fontawesome@latest

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!