Gathering detailed insights and metrics for react-icons
Gathering detailed insights and metrics for react-icons
Gathering detailed insights and metrics for react-icons
Gathering detailed insights and metrics for react-icons
@ant-design/icons-react
<h1 align="center"> Ant Design Icons for React </h1>
@radix-ui/react-icons
Radix UI React Icon Set
react-native-vector-icons
Customizable Icons for React Native with support for NavBar/TabBar, image source and full styling.
@mui/icons-material
Material Design icons distributed as SVG React components.
svg react icons of popular icon packs
npm install react-icons
Typescript
Module System
Node Version
NPM Version
89.3
Supply Chain
100
Quality
87.1
Maintenance
100
Vulnerability
87.6
License
TypeScript (61.75%)
JavaScript (13.48%)
SCSS (10.14%)
Astro (9.55%)
HTML (3.13%)
CSS (1.39%)
Shell (0.57%)
Total Downloads
362,596,764
Last Day
510,579
Last Week
2,705,634
Last Month
9,508,293
Last Year
114,545,335
11,821 Stars
690 Commits
760 Forks
53 Watching
9 Branches
109 Contributors
Minified
Minified + Gzipped
Latest Version
5.4.0
Package Id
react-icons@5.4.0
Unpacked Size
82.20 MB
Size
21.19 MB
File Count
143
NPM Version
9.6.7
Node Version
18.17.1
Publised On
03 Dec 2024
Cumulative downloads
Total Downloads
Last day
1.1%
510,579
Compared to previous day
Last week
3.5%
2,705,634
Compared to previous week
Last month
-12.1%
9,508,293
Compared to previous month
Last year
32.8%
114,545,335
Compared to previous year
1
Include popular icons in your React projects easily with react-icons
, which utilizes ES6 imports that allows you to include only the icons that your project is using.
1yarn add react-icons 2# or 3npm install react-icons --save
example usage
1import { FaBeer } from "react-icons/fa"; 2 3function Question() { 4 return ( 5 <h3> 6 Lets go for a <FaBeer />? 7 </h3> 8 ); 9}
View the documentation for further usage examples and how to use icons from other packages. NOTE: each Icon package has it's own subfolder under react-icons
you import from.
For example, to use an icon from Material Design, your import would be: import { ICON_NAME } from 'react-icons/md';
Note This option has not had a new release for some time. More info https://github.com/react-icons/react-icons/issues/593
If your project grows in size, this option is available. This method has the trade-off that it takes a long time to install the package.
1yarn add @react-icons/all-files 2# or 3npm install @react-icons/all-files --save
example usage
1import { FaBeer } from "@react-icons/all-files/fa/FaBeer"; 2 3function Question() { 4 return ( 5 <h3> 6 Lets go for a <FaBeer />? 7 </h3> 8 ); 9}
You can add more icons by submitting pull requests or creating issues.
You can configure react-icons props using React Context API.
Requires React 16.3 or higher.
1import { IconContext } from "react-icons"; 2 3<IconContext.Provider value={{ color: "blue", className: "global-class-name" }}> 4 <div> 5 <FaFolder /> 6 </div> 7</IconContext.Provider>;
Key | Default | Notes |
---|---|---|
color | undefined (inherit) | |
size | 1em | |
className | undefined | |
style | undefined | Can overwrite size and color |
attr | undefined | Overwritten by other attributes |
title | undefined | Icon description for accessibility |
Import path has changed. You need to rewrite from the old style.
1// OLD IMPORT STYLE 2import FaBeer from "react-icons/lib/fa/beer"; 3 4function Question() { 5 return ( 6 <h3> 7 Lets go for a <FaBeer />? 8 </h3> 9 ); 10}
1// NEW IMPORT STYLE 2import { FaBeer } from "react-icons/fa"; 3 4function Question() { 5 return ( 6 <h3> 7 Lets go for a <FaBeer />? 8 </h3> 9 ); 10}
Ending up with a large JS bundle? Check out this issue.
From version 3, vertical-align: middle
is not automatically given. Please use IconContext to specify className or specify an inline style.
1<IconContext.Provider value={{ style: { verticalAlign: 'middle' } }}>
className
StylingComponent
1<IconContext.Provider value={{ className: 'react-icons' }}>
CSS
1.react-icons { 2 vertical-align: middle; 3}
Dependencies on @types/react-icons
can be deleted.
1yarn remove @types/react-icons
1npm remove @types/react-icons
./build-script.sh
will build the whole project. See also CI scripts for more information.
1yarn 2cd packages/react-icons 3yarn fetch # fetch icon sources 4yarn build
First, check the discussion to see if anyone would like to add an icon set.
https://github.com/react-icons/react-icons/discussions/categories/new-icon-set
The SVG files to be fetched are managed in this file. Edit this file and run yarn fetch && yarn check && yarn build
.
https://github.com/react-icons/react-icons/blob/master/packages/react-icons/src/icons/index.ts
Note The project is not actively accepting PR for the preview site at this time.
The preview site is the react-icons
website, built in Astro+React.
1cd packages/react-icons 2yarn fetch 3yarn build 4 5cd ../preview-astro 6yarn start
The demo is a Create React App boilerplate with react-icons
added as a dependency for easy testing.
1cd packages/react-icons 2yarn fetch 3yarn build 4 5cd ../demo 6yarn start
SVG is supported by all major browsers. With react-icons
, you can serve only the needed icons instead of one big font file to the users, helping you to recognize which icons are used in your project.
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
12 commit(s) and 10 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
Found 4/19 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
16 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-13
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More