reactjsfont-awesomereact-font-awesome

Change color of font-awesome icons with React


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

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

Solution

  • 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>