Add Show Image Icon Inside Button in React Native Application

All the social networking Login like Google + Login, Facebook Login, Twitter Login and WordPress Login and Sharing content on them feature is on edge. They also provide the their own unique buttons code to share, post and Sign Up. But sometimes developers needs more control on their application design and then the custom Button component design with Image icon come. So in this tutorial we would going to design 2 custom Google+ Login and Facebook Login buttons with Image Icon Inside Button using TouchableOpacity component android iOS example tutorial. So let’s get started .

Contents in this project Add Show Image Icon Inside Button in React Native Android iOS App:

1. Create a folder inside your react native project named as Images.


2. Now download both icons from below. These icons is designed by myself and freely available for both professional and personal use. You can use them anywhere without my permission.

3. Copy both icons inside the Images folder like i did in below screenshot.

4. Open your project’s App.js file and import StyleSheet, View, Text, Image and TouchableOpacity component.

5. Create a Parent View in render’s return block. This would be our Main container view.

6. Create TouchableOpacity inside Root View. This would be our first Facebook Login button. The TouchableOpacity is used to WRAP the Image Icon + Horizontal Separator line + Text . You can also set onPress method on TouchableOpacity to perform any task on button click event.

Screenshot of Facebook Login button :

7. Now create another TouchableOpacity component for Google+ Login button.

Screenshot of Google+ Login button :

8. Now finally Create Custom CSS Style classes for all of them.

9. Complete source code for App.js File :

Screenshot in Android application :

Show Image Icon Inside Button

Screenshot in iOS application :