Gathering detailed insights and metrics for react-native-vector-icons
Gathering detailed insights and metrics for react-native-vector-icons
Gathering detailed insights and metrics for react-native-vector-icons
Gathering detailed insights and metrics for react-native-vector-icons
@types/react-native-vector-icons
TypeScript definitions for react-native-vector-icons
@react-native-vector-icons/ionicons
Ionicons font for react native vector icons
@expo/vector-icons
Built-in support for popular icon fonts and the tooling to create your own Icon components from your font and glyph map. This is a wrapper around react-native-vector-icons to make it compatible with Expo.
@react-native-vector-icons/material-icons
Material Icons font for react native vector icons
Customizable Icons for React Native with support for image source and full styling.
npm install react-native-vector-icons
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
17,462 Stars
632 Commits
2,126 Forks
203 Watching
4 Branches
151 Contributors
Updated on 27 Nov 2024
Minified
Minified + Gzipped
JavaScript (55.91%)
Shell (18.57%)
Java (9.79%)
Objective-C++ (8.02%)
CSS (3.23%)
Objective-C (1.21%)
HTML (1.2%)
Ruby (1.06%)
Smarty (1%)
Cumulative downloads
Total Downloads
Last day
5.7%
124,412
Compared to previous day
Last week
10.1%
647,030
Compared to previous week
Last month
9.7%
2,529,593
Compared to previous month
Last year
29.5%
24,353,210
Compared to previous year
2
27
Elevate your React Native applications with the power of customizable vector icons. Ideal for embellishing buttons, logos, and navigation or tab bars, these icons seamlessly integrate into your projects. Their versatility makes extension and styling effortless.
For the integration of .svg
files natively, you can explore react-native-vector-image
.
[!TIP] A new version of RNVI is coming soon. It has almost a zero config setup. Feedback welcome, please try it out on the monorepo branch
Should you find this library beneficial, kindly contemplate the option of sponsoring. Our envisioned endeavors encompass the restructuring of the repository into a monorepo architecture. This transition will empower independent versioning of icon sets, enhance performance, reduce bundle size, and simplify community contributions. Your sponsorship plays a pivotal role in materializing these advancements.
AntDesign
from AntFinance (298 icons)Entypo
by Daniel Bruce (v1.0.1 with 411 icons)EvilIcons
designed by Alexander Madyankin & Roman Shamin (v1.10.1 with 70 icons)Feather
created by Cole Bemis & Contributors (v4.28.0 featuring 286 icons)FontAwesome
by Dave Gandy (v4.7.0 containing 675 icons)FontAwesome 5
from Fonticons, Inc. (v5.15.3 offering 1598 free and 7848 pro icons)FontAwesome 6
designed by Fonticons, Inc. (v6.6.0 featuring 2016 free and 16150 pro icons)Fontisto
created by Kenan Gündoğan (v3.0.4 featuring 615 icons)Foundation
by ZURB, Inc. (v3.0 with 283 icons)Ionicons
crafted by Ionic (v7.1.0 containing 1338 icons)MaterialIcons
by Google, Inc. (v4.0.0 featuring 2189 icons)MaterialCommunityIcons
from MaterialDesignIcons.com (v6.5.95 including 6596 icons)Octicons
designed by Github, Inc. (v16.3.1 with 250 icons)Zocial
by Sam Collins (v1.4.0 with 100 icons)SimpleLineIcons
crafted by Sabbir & Contributors (v2.5.5 with 189 icons)1npm install --save react-native-vector-icons
To use the bundled icons on iOS, perform the following step:
run npx pod-install
in the iOS directory
Edit Info.plist
and add a property called Fonts provided by application (or UIAppFonts if Xcode autocomplete is not working):
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>FontAwesome6_Brands.ttf</string> 12 <string>FontAwesome6_Regular.ttf</string> 13 <string>FontAwesome6_Solid.ttf</string> 14 <string>Foundation.ttf</string> 15 <string>Ionicons.ttf</string> 16 <string>MaterialIcons.ttf</string> 17 <string>MaterialCommunityIcons.ttf</string> 18 <string>SimpleLineIcons.ttf</string> 19 <string>Octicons.ttf</string> 20 <string>Zocial.ttf</string> 21 <string>Fontisto.ttf</string> 22</array>
Above step might look something like this:
Note: Recompile your project after adding or removing fonts.
To make font management smoother on Android, use this method:
Edit android/app/build.gradle
(NOT android/build.gradle
) and add:
1apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
To customize the fonts being copied, use:
1project.ext.vectoricons = [ 2 iconFontNames: [ 'MaterialIcons.ttf', 'EvilIcons.ttf' ] // Specify font files 3] 4 5apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle") 6
1your-monorepo/ 2├─ node_modules/ 3│ ├─ react-native-vector-icons 4├─ apps/ 5│ ├─ YourApp/ 6│ │ ├─ android/ 7│ │ │ ├─ app/ 8│ │ │ │ ├─ build.gradle
Update paths like:
1project.ext.vectoricons = [ 2+ iconFontsDir: "../../../../node_modules/react-native-vector-icons/Fonts", 3 iconFontNames: ["YourFont.ttf", "..."] 4] 5 6- apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" 7+ apply from: "../../../../node_modules/react-native-vector-icons/fonts.gradle
⚠️ Reported issues have arisen when utilizing RNVI versions earlier than 9.0.0 within a monorepo context. Therefore, it's advisable to ensure your RNVI version is 9.0.0 or later.
To manually integrate the library, follow these steps:
Fonts
folder and paste them into android/app/src/main/assets/fonts
(ensure the folder name is lowercase, i.e., fonts
).getImageSource
SupportThe following steps are optional and are only necessary if you intend to utilize the Icon.getImageSource
function.
Edit the android/settings.gradle
file as shown below:
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 the android/app/build.gradle
(located in the app folder) as shown below:
1apply plugin: 'com.android.application' 2 3android { 4 ... 5} 6 7dependencies { 8 implementation fileTree(dir: "libs", include: ["*.jar"]) 9 //noinspection GradleDynamicVersion 10 implementation "com.facebook.react:react-native:+" // From node_modules 11 12+ implementation project(':react-native-vector-icons') 13}
Edit your MainApplication.java
(located deep within android/app/src/main/java/...
) as shown below (note that there are 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 }
Please note that this optional step is necessary only if your react-native app doesn't support auto-linking; otherwise, you can skip this.
To set up the library on your macOS project using react-native-macos
, follow these steps:
Browse to the node_modules/react-native-vector-icons
folder and drag the Fonts
folder into your project in Xcode. Ensure that your app is checked under "Add to targets," and select "Create folder references" when prompted.
Edit your Info.plist
and include a new property named Application fonts resource path (or ATSApplicationFontsPath
if Xcode's autocomplete isn't functioning or you're not using Xcode). Set the value of this property to Fonts
.
From your project's /ios
folder run:
1bundle exec pod install
Please note that after adding new fonts, you need to recompile your project. Also, make sure that the Fonts
folder is present under the Copy Bundle Resources section within the Build Phases of your Xcode project.
These steps will effectively integrate the vector icons library into your macOS project while utilizing the react-native-macos
framework.
To set up the library on your Windows project using react-native-windows
, follow these steps:
In the top-level projects (/windows/project-name/Assets
), copy and paste the font files.
Open your solution in Visual Studio:
a. Right-click the Assets folder in your solution.
b. Select Add > Existing Item.
c. Browse and select the fonts that you copied into /windows/project-name/assets
.
d. Click Add.
Please note that after adding new fonts, you need to recompile your project.
By following these steps, you'll seamlessly integrate the vector icons library into your Windows project, leveraging the react-native-windows
framework.
To port a react-native mobile app to web using react-native-web
you just need to ensure the fonts are known on the web-app side.
You will need add the font-family for each font you use to your css
You can debug missing font-families by looking in the Developer console in your web browser when debugging your web app.
NOTE: if you're using webpack or similar you may need to configure webpack to handle loading of ttf fonts, using url-loader or file-loader. See Web Setup for more details.
In your App.css
or similar add the font-family specifications:
1@font-face { 2 src: url(path/to/fonts/Ionicons.ttf); 3 font-family: "Ionicons"; 4} 5 6@font-face { 7 src: url(path/to/fonts/FontAwesome.ttf); 8 font-family: "FontAwesome"; 9} 10 11@font-face { 12 src: url(path/to/fonts/FontAwesome5_Brands.ttf); 13 font-family: "FontAwesome5_Brands"; 14 font-weight: 400; /* Regular weight */ 15 font-style: normal; 16} 17 18@font-face { 19 src: url(path/to/fonts/FontAwesome5_Regular.ttf); 20 font-family: "FontAwesome5_Regular"; 21 font-weight: 400; /* Regular weight */ 22 font-style: normal; 23} 24 25@font-face { 26 src: url(path/to/fonts/FontAwesome5_Solid.ttf); 27 font-family: "FontAwesome5_Solid"; 28 font-weight: 900; /* Bold weight for solid */ 29 font-style: normal; 30} 31 32@font-face { 33 src: url(path/to/fonts/MaterialIcons.ttf); 34 font-family: "MaterialIcons"; 35} 36 37@font-face { 38 src: url(path/to/fonts/Feather.ttf); 39 font-family: "Feather"; 40} 41 42@font-face { 43 src: url(path/to/fonts/MaterialCommunityIcons.ttf); 44 font-family: "MaterialCommunityIcons"; 45} 46 47/* TODO: Add other icons fonts here */
To integrate the library with your web project using webpack, follow these steps:
In your webpack configuration file, add a section to handle TTF files using url-loader
or file-loader
:
1{ 2 test: /\.ttf$/, 3 loader: "url-loader", // or directly file-loader 4 include: path.resolve(__dirname, "node_modules/react-native-vector-icons"), 5}
In your JavaScript entry point, consume the font files and inject the necessary style tag:
1 // Use the prebuilt version of RNVI located in the dist folder 2 import Icon from 'react-native-vector-icons/dist/FontAwesome'; 3 4 // Generate the required CSS 5 import iconFont from 'react-native-vector-icons/Fonts/FontAwesome.ttf'; 6 const iconFontStyles = `@font-face { 7 src: url(${iconFont}); 8 font-family: FontAwesome; 9 }`; 10 11 // Create a stylesheet 12 const style = document.createElement('style'); 13 style.type = 'text/css'; 14 15 // Append the iconFontStyles to the stylesheet 16 if (style.styleSheet) { 17 style.styleSheet.cssText = iconFontStyles; 18 } else { 19 style.appendChild(document.createTextNode(iconFontStyles)); 20 } 21 22 // Inject the stylesheet into the document head 23 document.head.appendChild(style);
By following these steps, you will seamlessly integrate the vector icons library into your web project using webpack, enabling you to effortlessly use the icons within your web application.
Upgrading this package often requires the font files linked to your projects to be updated as well. If the automatic linking works for you, running this again should update the fonts. Otherwise you need to follow the steps outlined in the installation section.
Icon
ComponentYou can either use one of the bundled icons above or roll your own custom font.
1import Icon from 'react-native-vector-icons/FontAwesome'; 2const myIcon = <Icon name="rocket" size={30} color="#900" />;
Any Text property and the following:
Prop | Description | Default |
---|---|---|
size | Size of the icon, can also be passed as fontSize in the style object. | 12 |
name | What icon to show, see Icon Explorer app or one of the links above. | None |
color | Color of the icon. | Inherited |
Prop | Description |
---|---|
getFontFamily | Returns the font family that is currently used to retrieve icons as text. Usage: const fontFamily = Icon.getFontFamily() |
getImageSource | Returns a promise that resolving to the source of a bitmap version of the icon for use with Image component et al. Usage: const source = await Icon.getImageSource(name, size, color) |
getImageSourceSync | Same as getImageSource but synchronous. Usage: const source = Icon.getImageSourceSync(name, size, color) |
getRawGlyphMap | Returns the raw glyph map of the icon set. Usage: const glyphMap = Icon.getRawGlyphMap() |
hasIcon | Checks if the name is valid in current icon set. Usage: const isNameValid = Icon.hasIcon(name) |
Since Icon
builds on top of the Text
component, most style properties will work as expected, you might find it useful to play around with these:
backgroundColor
borderWidth
borderColor
borderRadius
padding
margin
color
fontSize
NOTE: On android Text
doesn't currently support border*
styles, to circumvent this simply wrap your Icon
with a View
.
By combining some of these you can create for example :
Icon.Button
ComponentA convenience component for creating buttons with an icon on the left side.
1import Icon from 'react-native-vector-icons/FontAwesome'; 2const myButton = ( 3 <Icon.Button 4 name="facebook" 5 backgroundColor="#3b5998" 6 onPress={this.loginWithFacebook} 7 > 8 Login with Facebook 9 </Icon.Button> 10); 11 12const customTextButton = ( 13 <Icon.Button name="facebook" backgroundColor="#3b5998"> 14 <Text style={{ fontFamily: 'Arial', fontSize: 15 }}> 15 Login with Facebook 16 </Text> 17 </Icon.Button> 18);
Any Text
, TouchableHighlight
or TouchableWithoutFeedback
property in addition to these:
Prop | Description | Default |
---|---|---|
color | Text and icon color, use iconStyle or nest a Text component if you need different colors. | white |
size | Icon size. | 20 |
iconStyle | Styles applied to the icon only, good for setting margins or a different color. Note: use iconStyle for margins or expect unstable behaviour. | {marginRight: 10} |
backgroundColor | Background color of the button. | #007AFF |
borderRadius | Border radius of the button, set to 0 to disable. | 5 |
onPress | A function called when the button is pressed. | None |
Convenient way to plug this in into other components that rely on bitmap images rather than scalable vector icons. Takes the arguments name
, size
and color
as described above.
1Icon.getImageSource('user', 20, 'red').then(source =>
2 this.setState({ userIcon: source })
3);
Alternatively you may use the synchronous method Icon.getImageSourceSync
to avoid rendering glitches. Keep in mind that this method is blocking and might incur performance penalties. Subsequent calls will use cache however.
Some fonts today use multiple styles, FontAwesome 5 for example, which is supported by this library. The usage is pretty much the same as the standard Icon
component:
1import Icon from 'react-native-vector-icons/FontAwesome5'; 2 3const myIcon1 = <Icon name="comments" size={30} color="#900" />; // Defaults to regular 4const myIcon2 = <Icon name="comments" size={30} color="#900" solid />; 5const myIcon3 = <Icon name="comments" size={30} color="#900" light />; // Only in FA5 Pro
All static methods from Icon
is supported by multi-styled fonts.
Prop | Description |
---|---|
getFontFamily | Returns the font family that is currently used to retrieve icons as text. Usage: const fontFamily = Icon.getFontFamily(style) |
getImageSource | Returns a promise that resolving to the source of a bitmap version of the icon for use with Image component et al. Usage: const source = await Icon.getImageSource(name, size, color) |
getImageSourceSync | Same as getImageSource but synchronous. Usage: const source = Icon.getImageSourceSync(name, size, color) |
getRawGlyphMap | Returns the raw glyph map of the icon set. Usage: const glyphMap = Icon.getRawGlyphMap(style) |
hasIcon | Checks if the name is valid in current icon set. Usage: const isNameValid = Icon.hasIcon(name, style) |
getStyledIconSet | Use this to get a Icon component for a single style. Usage. const StyledIcon = Icon.getStyledIconSet(style) |
If no style argument is passed (or if it's invalid) the methods will default to a pre-defineds fallback.
Icon.Button
is supported, usage is just like Icon
:
1import Icon from 'react-native-vector-icons/FontAwesome5'; 2const myButton = ( 3 <Icon.Button name="facebook" onPress={this.loginWithFacebook} solid> 4 Login with Facebook 5 </Icon.Button> 6);
createIconSet(glyphMap, fontFamily[, fontFile])
Returns your own custom font based on the glyphMap
where the key is the icon name and the value is either a UTF-8 character or it's character code. fontFamily
is the name of the font NOT the filename. Open the font in Font Book.app or similar to learn the name. Optionally pass the third fontFile
argument for android support, it should be the custom font file name.
1import { createIconSet } from 'react-native-vector-icons'; 2const glyphMap = { 'icon-name': 1234, test: '∆' }; 3const Icon = createIconSet(glyphMap, 'FontName', 'font-name.ttf');
createIconSetFromFontello(config[, fontFamily[, fontFile]])
Convenience method to create a custom font based on a fontello config file. Don't forget to import the font as described above and drop the config.json
somewhere convenient in your project.
1import { createIconSetFromFontello } from 'react-native-vector-icons'; 2import fontelloConfig from './config.json'; 3const Icon = createIconSetFromFontello(fontelloConfig);
createIconSetFromIcoMoon(config[, fontFamily[, fontFile]])
1import { createIconSetFromIcoMoon } from 'react-native-vector-icons'; 2import icoMoonConfig from './selection.json'; 3const Icon = createIconSetFromIcoMoon( 4 icoMoonConfig, 5 'LineAwesome', 6 'line-awesome.ttf' 7);
Make sure you're using the Download option in IcoMoon, and use the .json
file that's included in the .zip
you've downloaded. You'll also need to import the .ttf
font file into your project, following the instructions above.
createMultiStyleIconSet(styles [, options])
1import { createMultiStyleIconSet } from 'react-native-vector-icons'; 2 3/* 4 * This is just example code, you are free to 5 * design your glyphmap and styles to your liking 6 */ 7 8import glyphmap from './glyphmap.json'; 9/* 10 * glyphmap = { 11 * "style1": [ 12 * "hello", 13 * "world" 14 * ], 15 * "style2": [ 16 * "foo", 17 * "bar" 18 * ] 19 * } 20 */ 21 22const glyphKeys = Object.keys(glyphmap); /* ["style1", "style2"] */ 23const options = { 24 defaultStyle: 'style1', 25 glyphValidator: (name, style) => glyphKeys.indexOf(name) !== -1, 26 fallbackFamily: (name) => { 27 for (let i = 0; i < glyphKeys.length; i++) { 28 const style = glyphKeys[i]; 29 if (glyphmap[style].indexOf(name) !== -1) { 30 return style; 31 } 32 } 33 34 /* Always return some family */ 35 return glyphKeys[0]; 36 } 37}; 38 39/* 40 * The styles object consits of keys, which will be 41 * used as the styles later, and objects which are 42 * used as style objects for the font. The style 43 * should have unique characteristics for each font 44 * in order to ensure that the right one will be 45 * chosen. FontAwesome 5 uses font weight since 46 * 5.7.0 in order to diffirentiate the styles but 47 * other properties (like fontFamily) can be used. 48 * It's just a standard RN style object. 49 */ 50const styles = { 51 style1: { 52 fontWeight: '700' 53 }, 54 style2: { 55 fontWeight: '100' 56 } 57}; 58 59const Icon = createMultiStyleIconSet(styles, options); 60 61/* Uses default style (style1) */ 62<Icon name={'hello'} /> 63<Icon name={'world'} style1 /> 64/* Default style is style1 but this will fall back to style2 */ 65<Icon name={'foo'} /> 66/* This will also fall back to style2 */ 67<Icon name={'foo'} style1 /> 68/* Regular use of style2 */ 69<Icon name={'bar'} style2 />
option | Description | default |
---|---|---|
defaultStyle | The name of the style to be used if no style is supplied during rendering. | Object.keys(styles)[0] |
fallbackFamily | Function for selecting a family if a glyph is not available. The function should accept the name of the glyph as a parameter. Returns the name if the family. | (name) => Object.keys(styles)[0] |
glyphValidator | Function for validating that a glyph is available for a chosen style. It has name and style as parameters, in that order. Returns true if the glyph is valid or false if it's not. | (name, style) => true |
You have to manually make a reference of your .ttf
on your xcodeproj Resources
folder and in Info.plist
.
React Native comes with an amazing animation library called Animated
. To use it with an icon, simply create an animated component with this line: const AnimatedIcon = Animated.createAnimatedComponent(Icon)
. You can also use the higher level animation library react-native-animatable.
Try the IconExplorer
project in Examples/IconExplorer
folder, there you can also search for any icon.
1import Icon from 'react-native-vector-icons/Ionicons'; 2 3function ExampleView(props) { 4 return <Icon name="ios-person" size={30} color="#4F8EF7" />; 5}
Since TabBarIOS
was removed from core in favor of @react-navigation/bottom-tabs, it is also removed as a convenience component from this library. Simply use the Icon
instead, but don't forget to import and link to this project as described above first.
Below is an example taken from react-navigation
:
1import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; 2import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'; 3 4const Tab = createBottomTabNavigator(); 5 6function MyTabs() { 7 return ( 8 <Tab.Navigator 9 initialRouteName="Feed" 10 screenOptions={{ 11 activeTintColor: '#e91e63', 12 }} 13 > 14 <Tab.Screen 15 name="Feed" 16 component={Feed} 17 options={{ 18 tabBarLabel: 'Home', 19 tabBarIcon: ({ color, size }) => ( 20 <MaterialCommunityIcons name="home" color={color} size={size} /> 21 ), 22 }} 23 /> 24 <Tab.Screen 25 name="Notifications" 26 component={Notifications} 27 options={{ 28 tabBarLabel: 'Updates', 29 tabBarIcon: ({ color, size }) => ( 30 <MaterialCommunityIcons name="bell" color={color} size={size} /> 31 ), 32 tabBarBadge: 3, 33 }} 34 /> 35 <Tab.Screen 36 name="Profile" 37 component={Profile} 38 options={{ 39 tabBarLabel: 'Profile', 40 tabBarIcon: ({ color, size }) => ( 41 <MaterialCommunityIcons name="account" color={color} size={size} /> 42 ), 43 }} 44 /> 45 </Tab.Navigator> 46 ); 47}
Since ToolbarAndroid
was removed from core, it is also removed as a convenience component from this library. Simply use getImageSourceSync
instead, but don't forget to import and link to this project as described above first.
1import ToolbarAndroid from '@react-native-community/toolbar-android'; 2import Icon from 'react-native-vector-icons/Ionicons'; 3 4const navIcon = Icon.getImageSourceSync('md-arrow-back', 24, 'white'); 5const overflowIcon = Icon.getImageSourceSync('md-more', 24, 'white'); 6const settingsIcon = Icon.getImageSourceSync('md-settings', 30, 'white'); 7const twitterIcon = Icon.getImageSourceSync('logo-twitter', 25, '#4099FF'); 8 9function ToolbarView(props) { 10 return ( 11 <ToolbarAndroid 12 title="Home" 13 titleColor="white" 14 navIcon={navIcon} 15 onIconClicked={props.navigator.pop} 16 actions={[ 17 { 18 title: 'Settings', 19 icon: settingsIcon, 20 show: 'always', 21 }, 22 { 23 title: 'Follow me on Twitter', 24 icon: twitterIcon, 25 show: 'ifRoom', 26 }, 27 ]} 28 overflowIcon={overflowIcon} 29 /> 30 ); 31}
1import { Text } from 'react-native'; 2import Icon from 'react-native-vector-icons/Ionicons'; 3 4function ExampleView(props) { 5 return ( 6 <Text> 7 Lorem <Icon name="ios-book" color="#4F8EF7" /> Ipsum 8 </Text> 9 ); 10}
If you already have an icon font with associated CSS file then you can easily generate a icon set with the generate-icon
script.
./node_modules/.bin/generate-icon path/to/styles.css --componentName=MyIcon --fontFamily=myicon > Components/MyIcon.js
Any flags not listed below, like --componentName
and --fontFamily
, will be passed on to the template.
-p
, --prefix
CSS selector prefix [default: ".icon-"]
-t
, --template
Template in JS template string format [default: "./template/iconSet.tpl"]
For default template please provide --componentName
and --fontFamily
.
-o
, --output
Save output to file, defaults to STDOUT
android/app/src/main/assets/fonts
.rm -rf android/app/build
..ttf
on your xcodeproj Resources
folder.Info.plist
, if you've added the whole folder and it's blue in color, then you need to add it to the path.rm -rf ios/build
Both npm and android file hierarchies tend to get very deep and even worse when you combine them. Since Windows file system has a max length, long file name addresses will result in numerous errors including Execution failed for task ':react-native-vector-icons:processReleaseResources'
. So try to keep the path to your project folder as short as possible.
You probably didn't update the font files linked to your native project after upgrading. However, this only applies to Android targets since iOS bundles the fonts when building the app (try to clean your build from Xcode if the problem exists). On android you can relink the project or you manually update the fonts. To have them automatically synced use the gradle approach.
Sometimes vendors decides to remove some icons from newer releases, this has nothing to do with this package. If you depend on an older version of a font you can add it as a custom font.
You are probably trying to use @expo/vector-icons
and react-native-vector-icons
at the same time. The expo package aliases this one and will take precedence. Use only one of these libraries in your project.
You will need to add JSX support for react-native-vector-icons
to your transpiler configuration e.g. babel.
For example, to add react-native-vector-icons
to the list of modules that support JSX (if using webpack) you may need to add the relative path to react-native-vector-icons
in the include section of your JSX config.
This may look something like the following if you are using Babel in webpack:
1 // Process application JS with Babel. 2 // The preset includes JSX, Flow, TypeScript, and some ESnext features. 3 { 4 test: /\.(js|mjs|jsx|ts|tsx)$/, 5 include: [ 6 paths.appSrc, 7+ // START - support for JSX in react-native-vector-icons 8+ path.resolve( 9+ __dirname, 10+ // modify this path to be relative to you webpack config, 11+ // "../node_modules/react-native-vector-icons", // <- most common 12+ "../../../node_modules/react-native-vector-icons", // <- if using workspaces 13+ ), 14+ // END - support got react-native-vector-icons 15 ], 16 loader: require.resolve("babel-loader"),
This project is licenced under the MIT License.
Any bundled fonts are copyright to their respective authors and mostly under MIT or SIL OFL.
No vulnerabilities found.
Reason
5 commit(s) and 21 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
binaries present in source code
Details
Reason
Found 23/30 approved changesets -- score normalized to 7
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
50 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
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