" /> " /> "/>

Change color of font-awesome icons with React

910 Views Asked by At

How do I change color of Font Awesome's icon using React, Firebase, NPM. Directly
Current code:

<FontAwesomeIcon icon={faCaretDown} size="2x" />
1

There are 1 best solutions below

1
Muthu Vijay On BEST ANSWER

You can use color props in Fontawesome component. like below

<FontAwesomeIcon icon = "faCaretDown"   color="green"/ >

or else you can use the below, usually fontawsome inherit colour and css size

<span style="font-size: 48px; color: Dodgerblue;">
    <i class="fas fa-bomb"></i>
</span>