Image react native

//Local import (relative path)
<Image source={require("./assets/snack-icon.png")} />
//External import (web path) you should specify the width and height
<Image source={{uri:"https://picsum.photos/200", width:200,height:200 }}/>

3.75
4
Awgiedawgie 440215 points

                                    Adding Image
Let us create a new folder img inside the src folder. We will add our image (myImage.png) inside this folder.

We will show images on the home screen.

App.js
import React from 'react';
import ImagesExample from './ImagesExample.js'

const App = () =&gt; {
   return (
      &lt;ImagesExample /&gt;
   )
}
export default App
Local image can be accessed using the following syntax.

image_example.js
import React, { Component } from 'react'
import { Image } from 'react-native'

const ImagesExample = () =&gt; (
   &lt;Image source = {require('C:/Users/Tutorialspoint/Desktop/NativeReactSample/logo.png')} /&gt;
)
export default ImagesExample

3.75 (4 Votes)
0
0
2
Krish 100200 points

                                    // useing require is more secure
&lt;Image 
	source = {require('C:/Users/Tutorialspoint/Desktop/NativeReactSample/logo.png')} 
/&gt;

0
0
4
9
Phoenix Logan 186120 points

                                    &lt;Image
  source={{ uri: 'app_icon' }}
  style={{ width: 40, height: 40 }}
/&gt;

4 (10 Votes)
0
4.17
6
Phoenix Logan 186120 points

                                    
import React from 'react';
import { View, Image, StyleSheet } from 'react-native';

const styles = StyleSheet.create({
  container: {
    paddingTop: 50,
  },
  tinyLogo: {
    width: 50,
    height: 50,
  },
  logo: {
    width: 66,
    height: 58,
  },
});

const DisplayAnImage = () =&gt; {
  return (
    &lt;View style={styles.container}&gt;
      &lt;Image
        style={styles.tinyLogo}
        source={require('@expo/snack-static/react-native-logo.png')}
      /&gt;
      &lt;Image
        style={styles.tinyLogo}
        source={{
          uri: 'https://reactnative.dev/img/tiny_logo.png',
        }}
      /&gt;
      &lt;Image
        style={styles.logo}
        source={{
          uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAYAAAA6oTAqAAAAEXRFWHRTb2Z0d2FyZQBwbmdjcnVzaEB1SfMAAABQSURBVGje7dSxCQBACARB+2/ab8BEeQNhFi6WSYzYLYudDQYGBgYGBgYGBgYGBgYGBgZmcvDqYGBgmhivGQYGBgYGBgYGBgYGBgYGBgbmQw+P/eMrC5UTVAAAAABJRU5ErkJggg==',
        }}
      /&gt;
    &lt;/View&gt;
  );
}

export default DisplayAnImage;

4.17 (6 Votes)
0
4
3
Awgiedawgie 440215 points

                                    		&lt;Image
        style={styles.tinyLogo}
        source={require('@expo/snack-static/react-native-logo.png')}
     	/&gt;

4 (3 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
react native import image how to image in react native &lt;Image source url in react native place image in react native react native adding images using image react native use image react native how to use image react native add image to react native project react native docs image component how to render react-native images adding image in react native import images react native image react native elements showing image in react native set a image in react native require image react native react native &lt;image react native img import image in react-native set image in react native add image in screen react native react native imaage add image in react native app image in react native style image in react native importing image in react native image in react native add image to react native app ract native image &lt;img /&gt; in react native add image in react-native react native image pass external url display image react native image rect native image reacgt native use images in react native app image component for react-native using images in react native react native iamge how we add img in react native add image to react native reacxt native image insert image in react native image recat native react native image' image react-native img use react native create image in react-native react natie image react native insert image img in react native image reacr native react native imgae how to import image in react native add image in react native element react-native Image add images react native putting an image on a react native app image set in react native images for react native importing a picture in react native using images in react-native how can i am add an image in my react native app how to import images in react native image require react native image react native import add image png react native how to add image react native inmage react native how to render image in react native image in react-native how to import image into the react native displaying images in react native uri in source react native image url react native react native images add react native render local image react native image using uri adding logo on react native native display img react native display image how to display image in react native &lt;Image react native react native add image images in react native add image to app.js page react native how to add image on page react native network image react native how to add uri images in react native image source as url react native png in react native import image in react native image source react native react native image uri image uri react native import image react native react native url image image height and width react native how to use img in react native how to set static url in react native image use an image react native image react n ways to show image in react native how to use image react antive image tag in react na how to add image in react native add inmage in react native image show in react native react native source for image react native const array image how to use image tag in react native react native image source react native show image show image in react native how to display an image in react native image in react natyives react nnative image import image to react native using image react native to fetch image react native using images in a component react native imge use image in react native image show react native photo in React native react native image example using image in react native add an image in react native react native images image source in react native image react native source display image in react native react native image source url src photo react native add image in react native adding image react native how to insert image in react native image in react naytive react native image from url react native image component image reactnative react native image tag image in react native react native image image component in react native image react native
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source