react-native-img-placeholder

1.0.0 • Public • Published

react-native-img-placeholder npm version

NPM

  • Support Android and iOS.
  • The image component that supports shows placeholderSource when load image network.
  • Show placeholderSource if the main source can't be loaded or error.
  • Support custom ActivityIndicator loading.

Require

React-native >= 0.46.x

What's new

Fixed render inside component

Installation

npm i --save react-native-img-placeholder

Please file an issue if you have any trouble!

Usage

import ImagePlaceholder from 'react-native-img-placeholder';
 
....
 
<ImagePlaceholder
    style={{ width: 320, height: 250 }}
    loadingStyle={{ size: 'large', color: 'blue' }}
    source={{ uri: 'https://via.placeholder.com/300/09f/fff.png' }}
/>

Options

Supports all Image properties.

Option Default Info
placeholderSource require('./Images/empty-image.png') Show placeholderSource if the source can't be loaded or error.
loadingStyle size: 'small'; color: 'gray' Style ActivityIndicator
isShowActivity true Show ActivityIndicator loading
placeholderStyle Style placeholder image
customImagePlaceholderDefaultStyle Custom style image placeholder default
borderRadius Border radius

License

ISC

Package Sidebar

Install

npm i react-native-img-placeholder

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

9.36 kB

Total Files

4

Last publish

Collaborators

  • immynk