Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-parallax-swiper

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-parallax-swiper

Full Screen Parallax Swiper Allowing Arbitrary UI Injection

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Native Parallax Swiper

Configurable parallax swiper that leverages useNativeDriver for 60FPS parallax. Allows for your own custom animations outside of this component.

Ways to use this component

  1. You have a background image that parallaxes while your UI moves at the ScrollView speed

Example 1

  1. You have no background image and all of your UI parallaxes

Example 2

☝️ React Native Zoomable for image zoom. Artwork by Daniel Mackey.

Installation

$ yarn add react-native-parallax-swiper

Usage

import ParallaxSwiper from 'react-native-parallax-swiper';
<ParallaxSwiper
  parallaxStrength={80}
  dividerWidth={8}
  dividerColor="black"
  backgroundColor="#bae"
  onMomentumScrollEnd={() => console.log('💩')}
>
  <View
    style={{
      flex: 1,
      alignItems: 'center',
      justifyContent: 'center',
     }}
     backgroundImage={'https://goo.gl/7Mvjji'}
    >
    <Text>Pass Arbitrary JSX to ParallaxSwiper as Children</Text>
  </View>
</ParallaxSwiper>

Props

PropTypeDefaultDescription
parallaxStrengthNumber80This number determines how slow parallax’ing element moves. Lower number yields a subtler parallax effect, higher number increases parallax effect.
dividerWidthNumber8The width of the divider between each slide. (horizontal only)
dividerColorStringblackColor of divider.
backgroundImageStringN/AThe image source. If used this becomes the background image that parallaxes. (remote URL only for now)
backgroundImageResizeModeStringcoverDetermines how to resize the image.
backgroundColorStringblackThe main view’s background color.
onMomentumScrollEndFunctionN/ACalled when ScrollView stops scrolling.
animatedScrollValueAnimated.Value0Optionally pass a new instance of Animated.Value to this prop to have access to the animated scroll value to animate your own components.
childrenReactComponentsN/AJSX to inject into the slide.
verticalBooleanfalseWhen true, ParallaxSwiper’s children are arranged vertically in a column instead of horizontally in a row.
showsHorizontalScrollIndicatorBooleanfalseWhen true, shows a horizontal scroll indicator. The default value is false.
showsVerticalScrollIndicatorBooleanfalseWhen true, shows a vertical scroll indicator. The default value is false.

TODO

  • Create Expo demos
  • Create examples
  • Expose current index
  • Expose ScrollView scrollTo Method
  • Fix Android
  • Expose ScrollView contentOffset
  • Add drag effects e.g. zoom, blur, darken
  • Expose rest of ScrollView props
  • Create <Slide/> component to replace arbitrary React Children Components? 🤔

Why another parallax component?

This component was created to emulate a specific iOS pattern that no react-native-parallax-whatever previously delivered. Native ScrollView, paging, and native driver for 60FPS. This style can be seen in apps like iOS Camera Roll, Twitter Moments, Kylie Jenner’s app, and Vevo’s app.

Contributors


Chris LeBlanc

[💻]

Questions or suggestions?

Hit me up on Twitter, or create an issue.

Copyright (c) 2017 Zachary Gibson Licensed under the MIT license.

Keywords

FAQs

Package last updated on 24 Aug 2017

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