0.4.0 • Published 2 years ago

react-native-images-scrollview v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Motivation

Provide a no-setup solution for a full screen image scroller with pinch and zoom on each image.

Installation

This library requires reanimated and gesture-handler. Follow their installation instructions.

Usage

// MyCoolHomeScreen.tsx
import * as React from 'react';
import { ImagesScrollView } from 'react-native-images-scrollview';

import images from '@assets/images';

export default function App() {
  return <ImagesScrollView urls={images} />;
}

API

PropTypeOptionalDefaultDescription
urlsstring[]NoN/AList of image urls to render.
onImagePress({ uri: string; index: number }) => voidYesN/ACallback that fires on single tap on image.
initialIndexnumberYes0Index of image so start on.
panScrollTriggerThresholdPercentagenumberYes0.2percentage of screen width to use to trigger scroll if image is zoomed and panned beyond threshold.

Example

To run the example app, clone the repo

cd example
yarn install

yarn ios
# or
yarn android

License

MIT


Made with create-react-native-library

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago