0

I am trying to place fontawesome icons onto my lwc component. Uploaded the zipped css file into the static resources and did referenced it in the lwc but no luck in getting this to work. Any suggestions?what is showing up instead of icon

1 Answers1

1

Unzip the downloaded file from fontawesome portal, upload the below highlighted files to your salesforce instance as static resources from css folder

enter image description here

LWC JS:

import faCss from '@salesforce/resourceUrl/faCss';
import faCss1 from '@salesforce/resourceUrl/faCss1';

LWC HTML

<template>
    <div>
        <i class="fa fa-user"></i>
    </div>
</template>
Naveen K N
  • 180
  • 1
  • 11
  • 1
    Not pretty sure whether this work as you need to load the script using `import { loadStyle } from 'lightning/platformResourceLoader';` – Shivang Gupta Apr 21 '23 at 02:08