GithubHelp home page GithubHelp logo

jiaoxuebing2014 / react-native-parallax Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oblador/react-native-parallax

0.0 2.0 0.0 107 KB

Parallax effects for React Native using Animated API

License: MIT License

Java 14.08% JavaScript 55.13% Objective-C 30.79%

react-native-parallax's Introduction

react-native-parallax

NOTE: This module requires React Native 0.8+

Installation

npm install --save react-native-parallax

Usage

Note: Parallax.Image elements must be direct descendants of Parallax.ScrollView

var Parallax = require('react-native-parallax');

var ParallaxView = React.createClass({
  render: function() {
    return (
      <Parallax.ScrollView>
        <Parallax.Image
          style={{ height: 200 }}
          overlayStyle={{ backgroundColor: 'rgba(0,0,0,0.3)'}}
          source={{ uri: 'http://loremflickr.com/640/480' }}
        >
          <Text>This is optional overlay content</Text>
        </Parallax.Image>
      </Parallax.ScrollView>
    );
  },
});

Parallax.ScrollView Properties

Any ScrollView property and the following:

Prop Description Default
scrollViewComponent What underlying component to compose around, must be ScrollView compatible. ScrollView

Parallax.Image Properties

Any Image property and the following:

Prop Description Default
onPress Fired when element is tapped. None
imageStyle Optional image style, width and height styles are set automatically. None
overlayStyle Optional overlay style, might be useful if you want a shaded background for better readability. None
parallaxFactor The speed of the parallax effect. Larger values require taller images or they will be zoomed in. 0.2

Demo

Demo

Example

Check full example in the Example folder.

License

MIT License. © Joel Arvidsson

react-native-parallax's People

Contributors

oblador avatar trane294 avatar

Watchers

James Cloos avatar Billy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.