I usually import the package with npm "@fortawesome/fontawesome-free": "^5.14.0" and at the top of my files import "@fortawesome/fontawesome-free/css/all.css"
Then I use the Html they provide in my components.
I just use <i className="fab fa-js"></i> instead of <i class="fab fa-js"></i>. You can add additional classes to change font color, font size etc.
I can't get it to work in CodeSandbox right now, because I have never used it before :) Might try again tonight, if you still need help.
I think it imports everything.
When I go to my app and check "Sources" in the Developer Tools in Chrome, I find an 'all.css' file with all the font awesome icons, roughly 4.500 lines.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I usually import the package with npm "@fortawesome/fontawesome-free": "^5.14.0" and at the top of my files
import "@fortawesome/fontawesome-free/css/all.css"
Then I use the Html they provide in my components.
I just use
<i className="fab fa-js"></i>
instead of<i class="fab fa-js"></i>
. You can add additional classes to change font color, font size etc.I can't get it to work in CodeSandbox right now, because I have never used it before :) Might try again tonight, if you still need help.
Thanks, good idea !
Do you know if the method i use to import FA icons only include the CSS i asked for in the build, or does it import everything in all.css ?
I think it imports everything.
When I go to my app and check "Sources" in the Developer Tools in Chrome, I find an 'all.css' file with all the font awesome icons, roughly 4.500 lines.