React Native Vector Icon for Android

--

Follow the below steps to install the react-native-vector-icons using npm:

  1. Run
    npm i react-native-vector-icons
  2. Go to
    android/app/build.gradle
  3. Add
    apply from: “../../node_modules/react-native-vector-icons/fonts.gradle”
  4. Rerun app:
    npx react-native run-android

Use React Native Vector Icon

  1. Go to the vector icon directory:
    https://oblador.github.io/react-native-vector-icons/
  2. Select the icon you wish to use.
    Example:
    - Search “happy”
    - Select the “happy-outline” icon from “Ionicons”
  3. Import Icon:
    import Ionicons from ‘react-native-vector-icons/Ionicons’;
  4. 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.

--

--

Chanchala Gorale
Chanchala Gorale

Written by Chanchala Gorale

Founder | Product Manager | Software Developer

No responses yet