Installations
npm install react-native-dynamic-vector-icons
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
18.16.0
NPM Version
9.5.1
Score
68.6
Supply Chain
89.9
Quality
76
Maintenance
100
Vulnerability
100
License
Releases
2.0.0
Published on 12 Sept 2024
Better IconType approach and typing 🥳
Published on 29 Jan 2023
IconType exportable type and much better handling 🚀
Published on 04 Jun 2022
Icon build is here and IconPropsBase is exportable now 😋
Published on 13 May 2021
Better for Testing and Types 🥳
Published on 30 Sept 2020
FontAwesome 5 Support & Better Structure 🥳
Published on 11 Sept 2020
Contributors
Unable to fetch Contributors
Languages
JavaScript (53.79%)
TypeScript (43.63%)
Shell (2.58%)
Developer
Download Statistics
Total Downloads
356,430
Last Day
252
Last Week
1,104
Last Month
5,362
Last Year
53,108
GitHub Statistics
99 Stars
1,352 Commits
13 Forks
3 Watching
7 Branches
4 Contributors
Package Meta Information
Latest Version
2.0.0
Package Id
react-native-dynamic-vector-icons@2.0.0
Unpacked Size
27.67 kB
Size
9.72 kB
File Count
28
NPM Version
9.5.1
Node Version
18.16.0
Publised On
12 Sept 2024
Total Downloads
Cumulative downloads
Total Downloads
356,430
Last day
-8.7%
252
Compared to previous day
Last week
-11.3%
1,104
Compared to previous week
Last month
13%
5,362
Compared to previous month
Last year
-46.1%
53,108
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
![React Native Bottom Bar](https://github.com/WrathChaos/react-native-dynamic-vector-icons/blob/master/assets/logo.png)
Installation
Add the dependency:
Pure React Native:
1npm i react-native-dynamic-vector-icons 2npm i react-native-vector-icons 3# iOS Only 4npx pod-install
Expo Version:
1"react-native-dynamic-vector-icons": "WrathChaos/react-native-dynamic-vector-icons#expo"
Peer Dependencies
IMPORTANT! You need install them.
"react-native-vector-icons": ">= 6.x.x"
Import
1import Icon, { IconType } from "react-native-dynamic-vector-icons";
Basic Usage
1<Icon 2 name="github" 3 type={IconType.AntDesign} 4 size={30} 5 color="purple" 6 onPress={() => {}} 7/>
Bundled Icon Sets
AntDesign
by AntFinance (297 icons)Entypo
by Daniel Bruce (411 icons)EvilIcons
by Alexander Madyankin & Roman Shamin (v1.10.1, 70 icons)Feather
by Cole Bemis & Contributors (v4.21.0, 279 icons)FontAwesome
by Dave Gandy (v4.7.0, 675 icons)FontAwesome 5
by Fonticons, Inc. (v5.7.0, 1500 (free) 5082 (pro) icons)Fontisto
by Kenan Gündoğan (v3.0.4, 615 icons)Foundation
by ZURB, Inc. (v3.0, 283 icons)Ionicons
by Ben Sperry (v4.2.4, 696 icons)MaterialIcons
by Google, Inc. (v3.0.1, 932 icons)MaterialCommunityIcons
by MaterialDesignIcons.com (v4.0.96, 4416 icons)Octicons
by Github, Inc. (v8.4.1, 184 icons)Zocial
by Sam Collins (v1.0, 100 icons)SimpleLineIcons
by Sabbir & Contributors (v2.4.1, 189 icons)
Installation for iOS and Android
List of all available fonts to copy & paste in info.plist (Most Stable)
1<key>UIAppFonts</key> 2<array> 3 <string>AntDesign.ttf</string> 4 <string>Entypo.ttf</string> 5 <string>EvilIcons.ttf</string> 6 <string>Feather.ttf</string> 7 <string>FontAwesome.ttf</string> 8 <string>FontAwesome5_Brands.ttf</string> 9 <string>FontAwesome5_Regular.ttf</string> 10 <string>FontAwesome5_Solid.ttf</string> 11 <string>Foundation.ttf</string> 12 <string>Ionicons.ttf</string> 13 <string>MaterialIcons.ttf</string> 14 <string>MaterialCommunityIcons.ttf</string> 15 <string>SimpleLineIcons.ttf</string> 16 <string>Octicons.ttf</string> 17 <string>Zocial.ttf</string> 18 <string>Fontisto.ttf</string> 19</array>
Note: you need to recompile your project after adding new fonts, also ensure that they also appear under Copy Bundle Resources in Build Phases.
If you want to use the TabBar/NavigatorIOS integration or use getImageSource
/getImageSourceSync
, then you need to add RNVectorIcons.xcodeproj
to Libraries and add libRNVectorIcons.a
to Link Binary With Libraries under Build Phases. More info and screenshots about how to do this is available in the React Native documentation.
Option: With react-native link
$ react-native link react-native-vector-icons
Note: Some users are having trouble using this method, try one of the others if you are too.
Option: With CocoaPods
Add the following to your Podfile
and run pod update
:
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
Edit Info.plist
as described above.
If you are using use_frameworks!
in your Podfile
you instead need to dynamically load the icon font by doing Icon.loadFont()
when boostrapping your application.
Note: You must be consuming React itself via CocoaPods for this to work, see React Native documentation on how to set that up.
Android
Option: With Gradle (recommended)
This method has the advantage of fonts being copied from this module at build time so that the fonts and JS are always in sync, making upgrades painless.
Edit android/app/build.gradle
( NOT android/build.gradle
) and add the following:
1apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
To customize the files being copied, add the following instead:
1project.ext.vectoricons = [ 2 iconFontNames: [ 'MaterialIcons.ttf', 'EvilIcons.ttf' ] // Name of the font files you want to copy 3] 4 5apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
Option: Manually
- Copy the contents in the
Fonts
folder toandroid/app/src/main/assets/fonts
(note lowercase fonts folder).
Integrating library for getImageSource
support
These steps are optional and only needed if you want to use the Icon.getImageSource
function.
-
Edit
android/settings.gradle
to look like this (without the +):1rootProject.name = 'MyApp' 2 3include ':app' 4 5+ include ':react-native-vector-icons' 6+ project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
-
Edit
android/app/build.gradle
(note: app folder) to look like this:1apply plugin: 'com.android.application' 2 3android { 4 ... 5} 6 7dependencies { 8 compile fileTree(dir: 'libs', include: ['*.jar']) 9 compile "com.android.support:appcompat-v7:23.0.1" 10 compile "com.facebook.react:react-native:+" // From node_modules 11+ compile project(':react-native-vector-icons') 12}
-
Edit your
MainApplication.java
(deep inandroid/app/src/main/java/...
) to look like this (note two places to edit):1package com.myapp; 2 3+ import com.oblador.vectoricons.VectorIconsPackage; 4 5.... 6 7 @Override 8 protected List<ReactPackage> getPackages() { 9 return Arrays.<ReactPackage>asList( 10 new MainReactPackage() 11+ , new VectorIconsPackage() 12 ); 13 } 14 15}
Configuration - Props
Property | Type | Default | Description |
---|---|---|---|
style | style | style | use this to change the Icon's style |
name | string | null | use this to change icon's itself |
type | IconType | null | set the icon's type |
size | number | null | changes the icon's size |
color | color | null | use this to change icon's color |
onPress | function | undefined | use this to set the icon's onPress functionality |
Credits
Special thanks to oblador, react-native-vector-icons to make a great icon library :) This library is a little wrapper for react-native-vector-icons to make their icon type dynamically.
Author
FreakyCoder, kurayogun@gmail.com
License
React Native Dynamic Vector Icons Library is available under the MIT license. See the LICENSE file for more info. )
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/WrathChaos/react-native-dynamic-vector-icons/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/WrathChaos/react-native-dynamic-vector-icons/main.yml/master?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 2 out of 2 npmCommand dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/1 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 29 are checked with a SAST tool
Reason
17 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm
- Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574
- Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6
- Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
2.8
/10
Last Scanned on 2025-01-27
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