React Native Vector Icons
React Native Vector Icons are the most popular custom icons of NPM GitHub library. It has more than 3K (3000) icons collection in it. All these icons are free to use. The React Native Vector icons come with complete customization such as icon size, icon color, and it also supports multiple styling.
Following are the list of icons category available in React Native Vector Icons. You can also visit at https://oblador.github.io/react-native-vector-icons/ for these icons.
Installation of React Native Vector Icons
1. Open your react native project folder in command prompt and execute the below code:
After successful execution of the above code, it adds the react-native-vector-icons library.
2. Open your_react_native_project->android -> app -> build.gradle file and put below code of line inside it.
3. Again open your_react_native_project -> android -> app -> build.gradle file and put the below code inside the dependency block.
your_react_native_project->android -> app -> build.gradle
After adding the above code, the build.gradle file looks like as:
4. Open your_react_native_project-> android-> settings.gradle file and add the below code:
your_react_native_project-> android-> settings.gradle
5. Open your_react_native_project -> android -> app -> src -> main -> java-> com-> your_project_name -> MainApplication.java file and import vector icons package using below line of code.
6. In the MainApplication.java file, call the react native vector icons below package name inside the return Arrays.
Linking of Dependency
After installing the above code, we need to link it with our project.
In the App.js file, create two constant named as facebook_button and twitter_button inside the render block. We call these constant directly into the TouchableOpacity component. The props of Icon.Button are given below:
Create two another constant of Icon named as android_icon and music_icon inside render block.