Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fortawesome/react-fontawesome

Package Overview
Dependencies
Maintainers
7
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fortawesome/react-fontawesome

Official React component for Font Awesome

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-0.11%
Maintainers
7
Weekly downloads
 
Created

What is @fortawesome/react-fontawesome?

The @fortawesome/react-fontawesome package is a React component for using Font Awesome icons in React applications. It provides a convenient way to include Font Awesome icons in your project and supports various features such as sizing, coloring, animations, and more.

What are @fortawesome/react-fontawesome's main functionalities?

Displaying icons

This feature allows you to display Font Awesome icons by importing the FontAwesomeIcon component and the specific icon you want to use from the free or pro libraries.

{"import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCoffee } from '@fortawesome/free-solid-svg-icons';

function App() {
  return (
    <div>
      <FontAwesomeIcon icon={faCoffee} />
    </div>
  );
}"}

Styling icons

You can style icons by passing props such as 'size' for the icon size and 'color' for the icon color.

{"import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCoffee } from '@fortawesome/free-solid-svg-icons';

function App() {
  return (
    <div>
      <FontAwesomeIcon icon={faCoffee} size='lg' color='blue' />
    </div>
  );
}"}

Animating icons

This feature allows you to animate icons, such as adding a spinning effect to icons by using the 'spin' prop.

{"import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSpinner } from '@fortawesome/free-solid-svg-icons';

function App() {
  return (
    <div>
      <FontAwesomeIcon icon={faSpinner} spin />
    </div>
  );
}"}

Layering and transforming icons

You can layer multiple icons on top of each other and apply transformations such as shrinking, rotating, or moving the icon.

{"import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCircle, faCheck } from '@fortawesome/free-solid-svg-icons';

function App() {
  return (
    <span className='fa-layers fa-fw'>
      <FontAwesomeIcon icon={faCircle} color='green' />
      <FontAwesomeIcon icon={faCheck} inverse transform='shrink-6' />
    </span>
  );
}"}

Other packages similar to @fortawesome/react-fontawesome

FAQs

Package last updated on 22 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc