Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
The most popular custom icons in the NPM GitHub collection are React Native Vector Icons. It has a collection of over 3000 icons. All of these icons are completely free to use. The React Native Vector icons allow comprehensive customization, including icon size, color, and styling options. Buttons, logos, and navigation/tab bars benefit from vector icons. Extend, style, and incorporate vector icons into your project with ease. Vector Icons can be used almost anywhere. You may discover a selection of icons in the react-native-vector-icons directory.
The font-size property of the style object can also be used to specify the icon's size.
12
name
See the Icon Explorer app or one of the links above to determine which icon to display.
None
color
The icon's color scheme.
Inherited
Icon.Button Component
A tool for making buttons with a left-hand icon.
Prop
Description
Default
color
Styles are applied to the icon only, good for setting margins or a different color. Note: use icon style for margins or expect unstable behavior.
white
size
Icon size.
20
iconStyle
Styles applied only on the icon are useful for establishing margins or changing the color. Note: You can expect erratic behavior if you use iconStyle for margins.
{marginRight: 10}
backgroundColor
Background color of the button.
#007AFF
borderRadius
Set the button's border-radius to 0 to disable it.
5
onPress
A function called when the button is pressed.
None
These components will also be used in our example. Now that we've covered the basics let's move on to the example. In this example, we'll make a simple screen with multiple icons and execute it in Android.
Installation Of Dependency
Install the react-native-vector-icons dependency to use the Icon component. The backgroundborder radiusis
To do so, open a terminal window and navigate to your project.
cd ProjectName
Run the command below.
npm install react-native-vector-icons
All dependencies will be copied into your node module directory using this command. – It's only to change the react-native-vector-icons dependency in your package.json file that you need to save.
Importing IconFiles In Android
To use Vector Icons on Android, we must first import the react-native-vector-icons icons.
In android/app/src/main, create an assets/fonts directory.
Copy all the font files from node modules/react-native-vector-icons/Fonts into the fonts directory once it's been created.
The most popular custom icons in the NPM GitHub collection are React Native Vector Icons. It has a collection of over 3000 icons. All of these icons are completely free to use. The React Native Vector icons allow comprehensive customization, including icon size, color, and styling options.
Is it possible to use react icons with react-native?
You can use the react-native vector icon as an icon. It has a variety of icons that we can use in your project to give it a more native appearance.
What's the best way to unlink react-native vector icons?
You may now unlink this dependency with "react-native unlink," which will be automatically included in your app. Ignore this message and notify the library maintainers if a library isn't compatible with auto-linking.
Are the react icons in SVG format?
Fortunately, with React, we can quickly develop a new SVG component that allows us to place our custom SVG icons anywhere we want.
How do you make an icon with an input field?
Icons are commonly added to webpages using the I and span> tags to add icons inside the input element. The fontawesome URL inside the head tag is required to add any icons to the web pages or in any specified region. Using the fa prefix before the icon's name, the fontawesome icon can be put.
Conclusion
In this article, we learned about Vector icons with the help of an example. This article discussed different topics like a list of vector icons, steps to use vector icons, and their types with the installation process.