React Native Vector Icon for Android
Feb 5, 2023
Follow the below steps to install the react-native-vector-icons using npm:
- Run
npm i react-native-vector-icons - Go to
android/app/build.gradle - Add
apply from: “../../node_modules/react-native-vector-icons/fonts.gradle” - Rerun app:
npx react-native run-android
Use React Native Vector Icon
- Go to the vector icon directory:
https://oblador.github.io/react-native-vector-icons/ - Select the icon you wish to use.
Example:
- Search “happy”
- Select the “happy-outline” icon from “Ionicons” - Import Icon:
import Ionicons from ‘react-native-vector-icons/Ionicons’; - Add the icon in the required place as shown below:
<Ionicons name=”happy-outline” style={{color: ‘#023595’}} size={16} />
Now you should be able to see the icon in the application.