Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@fortawesome/fontawesome-svg-core
Advanced tools
The @fortawesome/fontawesome-svg-core package is part of the Font Awesome system, which provides scalable vector icons that can instantly be customized — size, color, drop shadow, and anything that can be done with the power of CSS. This package is the core of Font Awesome and includes the necessary tools to define and use icons in a project.
Adding Icons
This code sample demonstrates how to add an icon to the library so it can be used throughout your application.
import { library } from '@fortawesome/fontawesome-svg-core';
import { faCoffee } from '@fortawesome/free-solid-svg-icons';
library.add(faCoffee);
Using Icons in React
This code sample shows how to use an icon in a React component with the FontAwesomeIcon component.
import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
const IconComponent = () => (
<div>
<FontAwesomeIcon icon='coffee' />
</div>
);
Customizing Icons
This code sample illustrates how to customize an icon's size and color.
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCoffee } from '@fortawesome/free-solid-svg-icons';
<FontAwesomeIcon icon={faCoffee} size='2x' color='blue' />
Layering and Text
This code sample shows how to layer icons and use text with icons.
import { library } from '@fortawesome/fontawesome-svg-core';
import { faCircle, faCheckCircle } from '@fortawesome/free-regular-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
library.add(faCircle, faCheckCircle);
<FontAwesomeIcon icon={['far', 'circle']} />
<FontAwesomeIcon icon={['far', 'check-circle']} />
React-icons includes a collection of icon sets including Font Awesome, Material Design, and more. It allows the use of icons as React components, similar to @fortawesome/fontawesome-svg-core but with a wider range of icon sets.
Ionicons is an open-sourced and MIT licensed icon pack. While @fortawesome/fontawesome-svg-core is part of a larger system with a focus on Font Awesome icons, Ionicons offers a different set of icons and is commonly used in Ionic projects.
"I came here to chew bubblegum and install Font Awesome 5 - and I'm all out of bubblegum"
$ npm i --save @fortawesome/fontawesome-svg-core
Or
$ yarn add @fortawesome/fontawesome-svg-core
Get started here. Continue your journey here.
Or go straight to the API documentation.
Start with GitHub issues and ping us on Twitter if you need to.
FAQs
The iconic font, CSS, and SVG framework
The npm package @fortawesome/fontawesome-svg-core receives a total of 1,432,514 weekly downloads. As such, @fortawesome/fontawesome-svg-core popularity was classified as popular.
We found that @fortawesome/fontawesome-svg-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.