New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-awesome-gallery

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-awesome-gallery

Awesome gallery with Reanimated v2

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
22K
increased by2.58%
Maintainers
1
Weekly downloads
 
Created
Source

Awesome gallery with Reanimated v2

Example usage of gallery

Installation

First you have to follow installation instructions of ReanimatedV2 and react-native-gesture-handler

yarn add react-native-awesome-gallery

Usage

import Gallery from 'react-native-awesome-gallery';

// ...

const images = ['https://image1', 'https://image2'];

return (
  <Gallery
    images={images}
    onIndexChange={(newIndex) => {
      console.log(newIndex);
    }}
  />
);

Props

PropDescriptionTypeDefault
imagesArray of urls to renderstring[]undefined
renderImage?Callback func which can be used to render custom image component, e.g FastImage. NOTE: You have to call setImageDimensions({width, height}) parameter after image is loaded(renderImageInfo: {uri: string, index: number, setImageDimensions: (imageDimensions: {width: number, height: number}) => void}) => React.ReactElementundefined
initialIndex?The initial image indexnumber0
onIndexChange?Is called when index of active image is changed(newIndex: number) => voidundefined
numToRender?Amount of images rendered in gallery simultaneouslynumber5
emptySpaceWidth?Width of empty space between imagesnumber30
doubleTapScale?Image scale when double tap is firednumber3
maxScaleMaximum scale user can set with gesturenumber6
styleStyle of containerViewStyleundefined

Events

PropDescriptionType
onSwipeToCloseFired when user swiped to top/bottomFunction
onTapFired when user tap on imageFunction
onDoubleTapFired when user double tap on imageFunction
onScaleStartFired when pinch gesture startsFunction
onPanStartFired when pan gesture startsFunction

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Keywords

FAQs

Package last updated on 05 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc