You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

expo-image

Package Overview
Dependencies
Maintainers
27
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-image

A cross-platform, performant image component for React Native and Expo with Web support

2.0.7
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
27
Weekly downloads
 
Created

What is expo-image?

The expo-image package is a powerful tool for handling images in Expo and React Native applications. It provides a range of functionalities including image loading, caching, and displaying images with various transformations and effects.

What are expo-image's main functionalities?

Basic Image Display

This feature allows you to display an image from a URL. The Image component from expo-image is used to load and display the image with specified dimensions.

import { Image } from 'expo-image';

const App = () => (
  <Image
    source={{ uri: 'https://example.com/image.jpg' }}
    style={{ width: 200, height: 200 }}
  />
);

Image Caching

This feature enables image caching to improve performance and reduce network usage. The cachePolicy prop can be set to 'disk' to cache the image on the device's disk.

import { Image } from 'expo-image';

const App = () => (
  <Image
    source={{ uri: 'https://example.com/image.jpg' }}
    cachePolicy='disk'
    style={{ width: 200, height: 200 }}
  />
);

Image Transformations

This feature allows you to apply transformations to images, such as rounding the corners. In this example, the borderRadius style is used to create a circular image.

import { Image } from 'expo-image';

const App = () => (
  <Image
    source={{ uri: 'https://example.com/image.jpg' }}
    style={{ width: 200, height: 200, borderRadius: 100 }}
  />
);

Image Placeholders

This feature allows you to display a placeholder image while the main image is loading. The placeholder prop is used to specify the URI of the placeholder image.

import { Image } from 'expo-image';

const App = () => (
  <Image
    source={{ uri: 'https://example.com/image.jpg' }}
    placeholder={{ uri: 'https://example.com/placeholder.jpg' }}
    style={{ width: 200, height: 200 }}
  />
);

Other packages similar to expo-image

Keywords

react-native

FAQs

Package last updated on 26 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts