react-native-gallery-image

1.0.7 • Public • Published

React Native Gallery Image

PNG

Preview

Layout doesn't break on rotate Selecting images Changing props
GIF GIF GIF

installation

You can install this package with the following command:

yarn add react-native-gallery-image

or

npm install react-native-gallery-image

In the top level component add

import ReactNativeGalleryImage from 'react-native-gallery-image';

export default class App extends Component {

  render() {
    return (
      <ReactNativeGalleryImage
        shouldFit={true}
        imagesEachRow={2}
        selectionColor="blue"
        onSelect={(selectedImages) => console.log(selectedImages)}
        onImagePress={(pressedImage) => console.log(pressedImage)}
      />
    );
}
}

Props

Props Type Notes Required Default
images Array Array of images ✔️
imagesEachRow Number Number of images needed in one row 3
shouldFit Boolean if true then images will fit on line if extra space is left in row false
selectionColor String Color of border that will appear on image selection 'blue'
onSelect function a function, which will be called when image is selected, returns array of selected images
onImagePress function a function, which will be called when individual image is pressed, returns pressed image

Example

Click here to download running example

Readme

Keywords

none

Package Sidebar

Install

npm i react-native-gallery-image

Weekly Downloads

7

Version

1.0.7

License

ISC

Unpacked Size

30.2 MB

Total Files

8

Last publish

Collaborators

  • izaan4