Coder Social home page Coder Social logo

trickyc0d3r / react-native-carousel-control Goto Github PK

View Code? Open in Web Editor NEW

This project forked from machadogj/react-native-carousel-control

0.0 0.0 0.0 23 KB

React Native Carousel control with support for iOS and Android

License: MIT License

JavaScript 100.00%

react-native-carousel-control's Introduction

React Native Carousel Control

React Native Carousel with support for both iOS and Android. carousel-demo

React >= 16 -> 2.x.x React < 16 -> 1.x.x

Installation

npm install react-native-carousel-control --save

Usage

import Carousel from "react-native-carousel-control";
//...
<Carousel>
    <Text>Hello</Text>
    <Text>World!</Text>
    <Text>From carousel</Text>
</Carousel>

The carousel has the following format:

     ------------
    |      v--- page
    |-   ----   -|
    | | |    | | |
    | | |    | | |
    | | |    | | |
    |-   ----   -|
    |^-- sneak   |
    |         ^--- gap
     ------------

pageStyle

Type: PropTypes.object

The style that will be applied on the page. For example:

<Carousel pageStyle={ {backgroundColor: "white", borderRadius: 5} }>

pageWidth

Type: PropTypes.number

The width of the page. By default it will adjust to deviceWidth - 100.

initialPage

Type: PropTypes.number

The index of the initial page. The first page is 0.

onPageChange

Type: PropTypes.func

This function will be called every time the page changes.

sneak

Type: PropTypes.number

How much of the adjacent pages will display (see format above).

currentPage

Type: PropTypes.number

Update this value to move carousel to a specific page. For example:

<Carousel currentPage={ this.state.pageNumber }>

swipeThreshold

Type: PropTypes.number

How much users have to swipe to go to the next/prev page. Default: 0.5 (half the page)

License

The MIT License (MIT)

Copyright (c) 2016 Gustavo Machado [email protected].

react-native-carousel-control's People

Contributors

ardycm avatar dmitrydyomin avatar jjzazuet avatar machadogj avatar markgoodyear 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.