You're viewing docs for v5.15.4, an older version of Font Awesome.

We provide more advanced packages that are suitable for more specialized situations. These packages are side-effect free and provide no automatic replacement of <i> tags to <svg> tags. (Although it can still be used through


Check out the API for Detailed Docs

The @fortawesome/fontawesome-svg-core package documentation can be found in our JavaScript API docs

When should you reach for this bad boy?

The SVG core package is helpful and recommended in the following cases:

These are ES6 module compatible for tools that support this, such as Rollup. Our icon content packages also support tree shaking which allows compatible tools to remove icons you are not using from your final build.


Comparing Font Awesome (JavaScript) and Font Awesome (JavaScript) SVG Core

Our Basic packages (@fortawesome/fontawesome-free and @fortawesome/fontawesome-pro) are aimed at individuals who would like to quickly integrate Font Awesome into their projects but do not want to invest the time and effort to understand what's going on under the hood. For this reason a lot of the behavior is automatic and works without any intervention.

In contrast, the fontawesome-svg-core package is for more specialized situations or for forming the underlying API to power other components or libraries. In fact, our own official components for Vue, React, Ember, and Angular all use the fontawesome-svg-core package under the hood.

Because of this the core package and the icon content packages avoid doing anything automatic or creating side-effects that make development with them difficult to control or reason.

One of the most common use cases where you would reach for the core package instead of using fontawesome-free or fontawesome-pro is to create a subset of icons to reduce your final bundled file size.

For this case you may still want the <i> tags to be replaced with <svg> tags. This is the default behavior when using the CDN or fontawesome-free and fontawesome-pro packages. This does not happen automatically when using the core package.

To accomplish this we will use the dom API.

  import { library, dom } from '@fortawesome/fontawesome-svg-core'
  import { faUserAstronaut } from '@fortawesome/free-solid-svg-icons'

  // We are only using the user-astronaut icon

  // Replace any existing <i> tags with <svg> and set up a MutationObserver to
  // continue doing this as the DOM changes.

More about the API

More information can be found about the Font Awesome JavaScript API docs which includes configuration and methods that can be used to tailor your usage as you see fit.