Font Awesome 5 use social/brand icons in React

后端 未结 5 1557
南笙
南笙 2021-02-18 17:59

The Font Awesome documentation shows only how to add regular/solid fonts to React. How about social icons?

First I grabbed the packages:

  npm i --save @         


        
5条回答
  •  不知归路
    2021-02-18 18:35

    Firstly

    npm i --save @fortawesome/fontawesome-svg-core 
    npm i --save @fortawesome/free-brands-svg-icons 
    npm i --save @fortawesome/react-fontawesome
    

    Then import in your project

    import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
    import {  faFacebookF , } from '@fortawesome/free-brands-svg-icons';
    

    Use this

    
    

提交回复
热议问题