Skip to main content
deleted 23 characters in body
Source Link
TylerH
  • 21.3k
  • 84
  • 84
  • 121

Very old question, but nowNow you can use their JS API, which will load only selected SVG files. This incredibly lowers the bundle size.

npm install @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icon 

and then

import { library, dom } from '@fortawesome/fontawesome-svg-core' import { faCamera } from '@fortawesome/free-solid-svg-icons' library.add(faCamera) dom.watch() 
<i class="fa-solid fa-camera"></i> 

Very old question, but now you can use their JS API, which will load only selected SVG files. This incredibly lowers the bundle size.

npm install @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icon 

and then

import { library, dom } from '@fortawesome/fontawesome-svg-core' import { faCamera } from '@fortawesome/free-solid-svg-icons' library.add(faCamera) dom.watch() 
<i class="fa-solid fa-camera"></i> 

Now you can use their JS API, which will load only selected SVG files. This incredibly lowers the bundle size.

npm install @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icon 

and then

import { library, dom } from '@fortawesome/fontawesome-svg-core' import { faCamera } from '@fortawesome/free-solid-svg-icons' library.add(faCamera) dom.watch() 
<i class="fa-solid fa-camera"></i> 
deleted 50 characters in body
Source Link

UseVery old question, but now you can use their APIJS API, which will load only selected SVG files. This incredibly lowers the bundle size.

npm install @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icon 

and then

import { library, icondom } from '@fortawesome/fontawesome-svg-core' import { faCamera } from '@fortawesome/free-solid-svg-icons' library.add(faCamera)   const camera = icondom.watch({ prefix: 'fas', iconName: 'camera' }) 
<i class="fa-solid fa-camera"></i> 

Use their API

npm install @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icon 

and then

import { library, icon } from '@fortawesome/fontawesome-svg-core' import { faCamera } from '@fortawesome/free-solid-svg-icons' library.add(faCamera)   const camera = icon({ prefix: 'fas', iconName: 'camera' }) 

Very old question, but now you can use their JS API, which will load only selected SVG files. This incredibly lowers the bundle size.

npm install @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icon 

and then

import { library, dom } from '@fortawesome/fontawesome-svg-core' import { faCamera } from '@fortawesome/free-solid-svg-icons' library.add(faCamera) dom.watch() 
<i class="fa-solid fa-camera"></i> 
Source Link

Use their API

npm install @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icon 

and then

import { library, icon } from '@fortawesome/fontawesome-svg-core' import { faCamera } from '@fortawesome/free-solid-svg-icons' library.add(faCamera) const camera = icon({ prefix: 'fas', iconName: 'camera' })