15

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?

Pablo Darde
  • 5,844
  • 10
  • 37
  • 55

1 Answers1

34

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!

Orlandster
  • 4,706
  • 2
  • 30
  • 45
Pablo Darde
  • 5,844
  • 10
  • 37
  • 55