1.0.0 • Published 4 years ago

react-native-img-placeholder v1.0.0

Weekly downloads
17
License
ISC
Repository
github
Last release
4 years ago

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.

OptionDefaultInfo
placeholderSourcerequire('./Images/empty-image.png')Show placeholderSource if the source can't be loaded or error.
loadingStylesize: 'small'; color: 'gray'Style ActivityIndicator
isShowActivitytrueShow ActivityIndicator loading
placeholderStyleStyle placeholder image
customImagePlaceholderDefaultStyleCustom style image placeholder default
borderRadiusBorder radius

License

ISC