GithubHelp home page GithubHelp logo

izhangyr / react-native-carousel-pager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jpapillon/react-native-carousel-pager

0.0 1.0 0.0 95.31 MB

React Native carousel pager.

License: MIT License

JavaScript 1.80% Python 0.28% Java 97.20% Objective-C 0.72%

react-native-carousel-pager's Introduction

react-native-carousel-pager

Version npm license

Installation

npm install react-native-carousel-pager --save

or

yarn add react-native-carousel-pager

Usage

import {View} from 'react-native';
import React, {Component} from 'react';
import CarouselPager from 'react-native-carousel-pager';

export default class Pager extends Component {
  onClickSomething() {
    this.carousel.goToPage(2);
  }

  render() {
    return (
      <View style={{flex: 1}}>
        <CarouselPager ref={ref => this.carousel = ref} initialPage={2} pageStyle={{backgroundColor: '#fff'}}>
          <View key={'page0'}></View>
          <View key={'page1'}></View>
          <View key={'page2'}></View>
          <View key={'page3'}></View>
        </CarouselPager>
      </View>
    );
  }
}

Properties

Name propType default value description
initialPage number 0 Initial page to display on render
vertical boolean false Set to true if carousel should be vertical
blurredZoom number 0.8 Zoom (number between 0 and 1) to apply to blurred pages
blurredOpacity number 0.8 Opacity (number between 0 and 1) to apply to blurred pages
animationDuration number 150 Animation duration between page changes
containerPadding number 30 Container padding (used to display part of preceding and following pages)
pageSpacing number 10 Space between pages
pageStyle object null Style to apply to each page
onPageChange function (page) => {} When current page changes, call onPageChange with parameter

Methods

Name propType description
goToPage number Scrolls to the given page

react-native-carousel-pager's People

Contributors

jpapillon avatar bergutman avatar weberjulian avatar mayank-baiswar avatar

Watchers

 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.