1

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

<FontAwesomeIcon icon={faCaretDown} size="2x" />
Simon
  • 63
  • 9
  • 1
    How are you using the font? Some NPM package? Directly?... – Dominic May 24 '22 at 16:24
  • 1
    What have you tried and what didn't work as expected? How do you style your elements and have you applied that styling to these elements? Are you just using plain CSS? Something else? Please elaborate on what you've tried and what isn't working. – David May 24 '22 at 16:26
  • You should check this out and include some examples of things you have tried, what specifically didn't work, etc: https://stackoverflow.com/help/how-to-ask – jharris711 May 24 '22 at 16:27
  • I tried using style directly. My code: `` – Simon May 24 '22 at 16:34

1 Answers1

1

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>
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 24 '22 at 17:38