Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@fortawesome/react-fontawesome

FortAwesome5.5mMIT3.1.0TypeScript support: included

Official React component for Font Awesome

fontawesome, font-awesome, react, javascript, svg, icons

readme

Official Javascript Component

react-fontawesome

npm

Font Awesome React component using SVG with JS

Documentation

Version 3.0.0 is a major update for react-fontawesome with the library being rewritten from plain JS to TypeScript, amongst a number of performance improvements and optimisations to the FontAwesomeIcon React component.

While it is a major update, there should be no breaking changes aside from those noted in the Compatibility section below.

Compatibility

With the release of FontAwesome v7, we have marked v5 as End-of-Life. Both v6 and v7 will continue to be supported.

In react-fontawesome v3.0.0 we have also dropped support for End-of-Life versions of React and Node.js as well as IE11 browser support.

If you need to use react-fontawesome with legacy versions, please consult the table below.

React version react-fontawesome version FontAwesome Core versions Node versions
>= 18.0.0 3.x.x 6.x, 7.x 20.x, 22.x, 24.x
>= 16.3.0 0.2.x 5.x, 6.x, 7.x 18.x, 20.x
< 16.3.0 0.1.x 5.x, 6.x 14.x, 16.x

Official documentation is hosted at fontawesome.com:

Check it out here

How to Help

Review the following docs before diving in:

And then:

Contributors

The following contributors have either helped to start this project, have contributed code, are actively maintaining it (including documentation), or in other ways being awesome contributors to this project. We'd like to take a moment to recognize them.

Name GitHub
Nate Radebaugh @NateRadebaugh
Kirk Ross @kirkbross
Prateek Goel @prateekgoel
Naor Torgeman @naortor
Matthew Hand @mmhand123
calvinf @calvinf
Bill Parrott @chimericdream
Mike Lynch @baelec
Lukáš Rod @rodlukas
Proudust @proudust
Tiago Sousa @TiagoPortfolio
Alexey Victorov @AliMamed
Calum Smith @cpmsmith
squiaios @squiaios
WyvernDrexx @WyvernDrexx
Jon Defresne @jdufresne
Charles Harwood @charles4221
Font Awesome Team @FortAwesome

If we've missed someone (which is quite likely) submit a Pull Request to us and we'll get it resolved.

Releasing this project (only project owners can do this)

See DEVELOPMENT.md

changelog

Changelog

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

3.1.0 (2025-10-03)

Features

  • custom cssPrefix support (ad42835)
  • layers: add support for layers with FontAwesomeLayers component (2c84902)

Bug Fixes

  • better export path for CustomPrefixProvider (663cd25)
  • browser-support: don't use string.replaceAll to fix safari 12 support (1776e3a)

Testing

  • layers: add unit tests for FontAwesomeLayers (d31480b)
  • utils: unit tests for withPrefix utility (982f649)

Documentation

  • add inline documentation for CustomPrefixProvider (46f69d4)
  • remove .env requirement (c942c6a)

Chores

  • release: use @semantic-release/exec for multi-publish rather than third-party plugin (5a47e13)

3.1.0 (2025-10-03)

Features

  • custom cssPrefix support (ad42835)
  • layers: add support for layers with FontAwesomeLayers component (2c84902)

Bug Fixes

  • better export path for CustomPrefixProvider (663cd25)
  • browser-support: don't use string.replaceAll to fix safari 12 support (1776e3a)

Testing

  • layers: add unit tests for FontAwesomeLayers (d31480b)
  • utils: unit tests for withPrefix utility (982f649)

Documentation

  • add inline documentation for CustomPrefixProvider (46f69d4)
  • remove .env requirement (c942c6a)

Chores

  • release: use @semantic-release/exec for multi-publish rather than third-party plugin (5a47e13)

3.0.2 (2025-09-01)

Bug Fixes

  • constants: resolve JSON import errors for vite/remix users (850a804)
  • test: flaky converter performance test in CI (8f43f0e)
  • WCAG: correctly read aria-label and ensure aria-hidden is false when label present (19ddeb3)

Testing

  • converter: fix unit test for aria-label handling (8c49cdc)
  • remove flaky test (f9605ab)
  • remove unnecessary test conditionals for v5 (fd5bf9b)

Chores

  • don't include release notes in release commit (78ce3f8)
  • dx: integrate semantic-release and commitlint (de5b958)
  • remove dependency on semver (066019b)
  • update release config for better changelogs (7d2c242)

CI/CD

  • actions: refactor CI workflow to split some jobs out of matrix (d0d1fb6)
  • actions: use commitlint github action (4ab8726)
  • use public npm registry for npm ci (69ea57b)

3.0.1 - 2025-08-27

Bug Fixes

  • Added additional module resolution configs in package.json (b078d99)
  • Refactored SVGCore version checks to use dynamic import to fix #589 (bc7cad0)

3.0.0 - 2025-08-22

BREAKING

  • Dropped support for end-of-life FontAwesome versions (below v6), Node versions (below 20.x) and React versions (below 18.x)
  • Dropped support for browser versions that don't support the ES2020 standard, namely JavaScript built-in: globalThis

Changes

  • Rewrote the entire library from plain JavaScript to TypeScript
  • Replaced rollup with tsup for providing both ESM and CJS exports from one TypeScript source
  • Removed prop-types in favour of colocated typings for React component props
  • Added better type definitions to each prop including examples of usage
  • Upgraded eslint from v6 to v9, rewrote config as Flat Config, modernised ESLint config, plugins and rules
  • Refactored all unit tests from the deprecated react-test-renderer to the industry standard @testing-library/react
  • Upgraded all other development dependencies to latest versions as of release date
  • Optimised FontAwesomeIcon by reducing per-render function calls and memory allocations
  • Optimised classList function by removing runtime semver checks and array operations
  • Optimised converter with a full rewrite for significant performance increases (~70%)
  • Moved inline class strings from getClassListFromProps to pre-computed maps

Bug Fixes

  • Fixed accessibility ID generation (titleId, maskId) for SSR ensuring a consistent ID across server and client renders (#93, #550, #573)
  • Fixed TypeScript errors when styling duotone icons with CSS variables (#509)
  • Fixed aria-hidden so it is false if there is a non-empty aria-label attribute (#126)
  • Resolved large number of npm audit issues by removing and updating dependencies

0.2.x

Previous 0.2.x change log available here


0.1.x

Previous 0.1.x change log available here