Socket
Socket
Sign inDemoInstall

react-native-keyboard-aware-parallax-scroll-view

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-keyboard-aware-parallax-scroll-view

React Native Keyboard Aware ScrollView


Version published
Weekly downloads
5
increased by25%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

React Native Keyboard Aware Parallax ScrollView

Motivation

We needed a parallax view with native animation and a scrollView that scrolls automatically when focussing a TextField. As seen in the FLAVR app Google play iTunes store

Preview

(Screenshot belongs to FLAVR NV, all rights reserved)

Setup

Install the dependency with npm or yarn:

yarn add react-native-keyboard-aware-parallax-scroll-view

Import into your component

import ParallaxKeyboardAwareScrollView from 'react-native-keyboard-aware-parallax-scroll-view'; 

Example

function ExampleComponent(props) {
    return (
        <ParallaxKeyboardAwareScrollView
          backgroundImage={{ uri: kitchenPicture }}
          imageHeight={160}
          onScroll={props.onScroll}
        >
            {renderContent()}
        </ParallaxKeyboardAwareScrollView>
    );
}

Properties

NameTypeDefault valueDescription
imageHeightNumber200The height of the header image
onScrollFunctionAdditional scroll handler
backgroundImageObjectImage resource for the background image
backgroundFunctionInstead of an image, render a component on the background (function that returns component)
headerFunctionFunction that renders header overlay component

Methods

To use scrollToPostion and other scrollView methods, just use the reference.scrollView (e.g. this.kapsv.scrollView.scrollToPosition)

<ParallaxKeyboardAwareScrollView
  ref={(kapsv) => { this.kapsv = kapsv; }}
>
  {renderContent()}
</ParallaxKeyboardAwareScrollView>

Contribute

Make sure eslint has no issues before making a PR

npm run lint

FAQs

Last updated on 08 Jun 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc