When using Font Awesome with Vue.js, you can put our official vue-fontawesome component to work to make everything just right.


Before You Get Started

Make sure you:

We recommend the official vue-fontawesome component (described below), which uses the SVG + JS method to render icons. But you can opt to use the Web Fonts with CSS method if you prefer.

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

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

1. Add SVG Core

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

npm i --save @fortawesome/fontawesome-svg-core
yarn add @fortawesome/fontawesome-svg-core

Find out more about what's in Font Awesome core

2. Add Icon Packages


Next, you'll install the icons you want to use - you can choose Free or Pro icons, and select any of our styles.

Free Icon Packages

For Free icons, you can add any or all of the following styles:

# Free icons styles
npm i --save @fortawesome/free-solid-svg-icons
npm i --save @fortawesome/free-regular-svg-icons
npm i --save @fortawesome/free-brands-svg-icons
# Free icons styles
yarn add @fortawesome/free-solid-svg-icons
yarn add @fortawesome/free-regular-svg-icons
yarn add @fortawesome/free-brands-svg-icons

Pro Icon Packages

You'll first need to set up access with your secret Font Awesome npm token and global or per-project access to use Pro icons.

Configure Access for Pro

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

# Pro icons styles
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/sharp-solid-svg-icons
npm i --save @fortawesome/sharp-regular-svg-icons
npm i --save @fortawesome/sharp-light-svg-icons
# Pro icons styles
yarn add @fortawesome/pro-solid-svg-icons
yarn add @fortawesome/pro-regular-svg-icons
yarn add @fortawesome/pro-light-svg-icons
yarn add @fortawesome/pro-thin-svg-icons
yarn add @fortawesome/pro-duotone-svg-icons
yarn add @fortawesome/sharp-solid-svg-icons
yarn add @fortawesome/sharp-regular-svg-icons
yarn add @fortawesome/sharp-light-svg-icons

Font Awesome Sharp requires Pro and specific versions!

Make sure you have an active Pro-level plan or a Pro license with access to the specific versions that include Sharp's styles.

3. Add the Vue Component


And lastly, install the Font Awesome Vue component:

Using Vue 2 or Vue 3?

How you install our vue-fontawesome component will be different depending on whether you are using Vue 2 or Vue 3. Make sure to only install the appropriate one that matches the version of Vue you are using.

# for Vue 2.x
npm i --save @fortawesome/vue-fontawesome@latest-2

# for Vue 3.x
npm i --save @fortawesome/vue-fontawesome@latest-3
# for Vue 2.x
yarn add @fortawesome/vue-fontawesome@latest-2

# for Vue 3.x
yarn add @fortawesome/vue-fontawesome@latest-3

You're Ready to Add 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 Vue project and then use their power to bring order and style to your UI!

Add Some Icons!