1.3.0 • Published 4 years ago

react-native-photo-browse v1.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

react-native-photo-browse

npm version Build Status

Here is a browser page for multiple local or remote photos.

It supports:

  • Multiple photos.
  • Local image or remote url.
  • Delete item.
  • Save item to local.
  • Image for placeholder or fail load.
  • Orientation supported.

Install

Install by Yarn:

yarn add react-native-photo-browse

Install by NPM:

npm install --save react-native-photo-browse

Usage

First import in the file:

import * as PhotoBrowser from 'react-native-photo-browse';

Then call method in function:

func = () => {
  const options = {
    // ...options
  };
  PhotoBrowser.showPhotoBrowserPage(options);
}

Options

NameDescription
imagesImage urls array to show
failImageA placeholder image when image is invalid
currentIndexInitial index of image to show. Default is 0
loadingTextLoading tips
onCloseCallback method when close
supportedOrientationsOrientations supported for Modal
successDownloadTextDownLoad and Save success tips
cancelDownloadTextcancel DownLoad tips
clickdButtonIconclickdButton element
unClickdButtonIconunClickdButton element
closeIconstop download element
startDownloadto download picture

Global Settings

You can change settings globally.

import {PhotoBrowserPage} from 'react-native-photo-browse';

PhotoBrowserPage.defaultProps.xxx = yyy;

xxx is a key of options