gxsshallot / react-native-photo-browse

A browser page for multiple local or remote photos.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-photo-browse

npm version

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

Name Description
images Image urls array to show
failImage A placeholder image when image is invalid
currentIndex Initial index of image to show. Default is 0
canDelete Enable or disable delete button. Default is false
canSave Enable or disable save button. Default is false
okLabel Label of OK button
deleteLabel Label of Delete button
saveLabel Label of Save button
saveSuccessText Save success tips
saveFailureText Save failure tips
loadingText Loading tips
onClose Callback method when close
supportedOrientations Orientations supported for Modal

Global Settings

You can change settings globally.

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

PhotoBrowserPage.defaultProps.xxx = yyy;

xxx is a key of options

About

A browser page for multiple local or remote photos.

License:MIT License


Languages

Language:JavaScript 100.0%