I have followed the instructions to use svg icons of angular-fontawesome 5 icons. Please find the link below
https://www.npmjs.com/package/@fortawesome/angular-fontawesome
As a first step
npm i --save @fortawesome/fontawesome-svg-core
npm i --save @fortawesome/angular-fontawesome
If I am correct to use the brand icons
npm i --save @fortawesome/free-brands-svg-icons
Step two: In app.module.ts file: Imported the following
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
import {fab, faFacebookSquare, faGoogle} from '@fortawesome/free-brands-svg-icons';
Step three: As per the primeng documentation I want to use the brand icons inside the button.
<div class="center-text">
<p-button icon="fab fa-google" label="Click"></p-button>
</div>
No errors in the console. But couldnt see the icon in display.
As an alternative way:
<div class="center-text">
<i class="fab fa-google"></i>
<p-button label="Click"></p-button>
</div>
Still no output. Kindly help how to bring the brand icons inside the primeng buttons.
To use the Free Font Awesome 5 icons, you can choose to download the Font Awesome library, or you can sign up for an account at Font Awesome, and get a code (called KIT CODE) to use when you add Font Awesome to your web page.
Backward Compatible by Default! If your project uses Version 5 icons, style names, or custom CSS rules with Font Awesome @font-face rules, your Kit will automatically update icons to use Version 6!
Although Font Awesome is the most popular icon font, many web developers don't use it because of its excessive size. The default minified resource size of Font Awesome (4.7. 0) is 110 KB and it can be a lot bigger than that depends on which font source is in use.
To use Font Awesome together with PrimeNG you need to use the standard fontawesome package, not angular-fontawesome.
npm install --save-dev @fortawesome/fontawesome-free
And in your angular.json file:
"styles": [
"node_modules/@fortawesome/fontawesome-free/css/all.min.css",
...
],
See https://forum.primefaces.org/viewtopic.php?t=56786 for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With