react-native-thumbnail-grid-expo
The photo thumbnail grid with image cached
Last updated 7 months ago by thanh_classfunc .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install react-native-thumbnail-grid-expo 
SYNC missed versions from official npm registry.

React Native Photo Grid

FOSSA Status

Code:

const images = [
  'https://cdn.pixabay.com/photo/2017/06/09/09/39/adler-2386314_960_720.jpg',
  'https://cdn.pixabay.com/photo/2017/06/02/18/24/fruit-2367029_960_720.jpg',
  'https://cdn.pixabay.com/photo/2016/08/12/22/34/apple-1589869_960_720.jpg'
]
...
<MediaGrid source={images} onPressImage={uri => this.showImage(uri)} />

Custom Image source object

The source prop also accepts an Array of source objects like so:

const images = [
  {
    uri: 'https://cdn.pixabay.com/photo/2017/06/09/09/39/adler-2386314_960_720.jpg',
    headers: {
      Authorization: 'Bearer xyz'
    }
  },
  {
    uri: 'https://cdn.pixabay.com/photo/2017/06/02/18/24/fruit-2367029_960_720.jpg',
    headers: {
      Authorization: 'Bearer xyz'
    }
  },
  {
    uri: 'https://cdn.pixabay.com/photo/2016/08/12/22/34/apple-1589869_960_720.jpg'
    headers: {
      Authorization: 'Bearer xyz'
    }
  }
]
...
<MediaGrid source={images} onPressImage={source => this.showImage(source.uri)} />

Props

Property Type Description
source PropTypes.array Array containing Image uri string or source object
width PropTypes.number Container width
height PropTypes.number Container height
ratio PropTypes.float Split screen ratio
style PropTypes.object Container styles
imageStyle PropTypes.object Image styles
imageProps PropTypes.object Image props
onPressImage PropTypes.func Callback when press image
emptyImage default empty image load

Image props

Property Description
placeholderSource Show placeholderSource if the source can't be loaded or error.
loadingStyle Style ActivityIndicator {size: 'small'; color: 'gray'}
isShowActivity Show ActivityIndicator loading
placeholderStyle Style placeholder image

License

FOSSA Status

Current Tags

  • 2.2.0                                ...           latest (7 months ago)

8 Versions

  • 2.2.0                                ...           7 months ago
  • 2.1.0                                ...           7 months ago
  • 2.0.0                                ...           8 months ago
  • 1.2.2                                ...           8 months ago
  • 1.2.1                                ...           8 months ago
  • 1.2.0                                ...           8 months ago
  • 1.1.0                                ...           8 months ago
  • 1.0.0                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 8
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |