12

Basically I'm trying to use two icons:

  1. <i class="fas fa-heart"></i> Solid heart icon

  2. <i class="far fa-heart"></i> Regular heart icon (outlined)

The first one I got with the following code:

<FontAwesomeIcon icon={faHeart} />

How can I get the second one?

4

1 回答 1

26

After some reading in the react-fontawesome docs I figured out how to do outlined icons.

For the first one I need the package @fortawesome/free-solid-svg-icons Then I need to import the icons as the following:

import { faHeart, faTrash } from '@fortawesome/free-solid-svg-icons'

The second one, I need the package @fortawesome/free-regular-svg-icons

Then I just import the following.

import { faHeart as farHeart } from '@fortawesome/free-regular-svg-icons'

That's it!

于 2019-11-28T15:47:14.343 回答