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

react-native-pg-swiper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-pg-swiper

Page Swiper component for React Native.

  • 0.3.121
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

react-native-pg-swiper

Page Swiper component for React Native.

Getting Started

  • Installation
  • Basic Usage
  • Properties
  • Examples

Installation

$ npm i react-native-pg-swiper --save
$ yarn add react-native-pg-swiper

Basic Usage

  • Edit your app.js, like this:
import React from 'react';
import Swiper from 'react-native-pg-swiper';
import { AppRegistry, StyleSheet, Text, View } from 'react-native';

var styles = StyleSheet.create({
  wrapper: {
  },
  slide1: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#9DD6EB',
  },
  slide2: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#97CAE5',
  },
  slide3: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#92BBD9',
  },
  text: {
    color: '#fff',
    fontSize: 30,
    fontWeight: 'bold',
  }
})

changePage(index) {
  this.refs.swiper.changePage(index);
}

class Swiper extends React.Component {
  render() {
    return (
      <Swiper ref='swiper' style={styles.wrapper}>
        <View style={styles.slide1}>
          <Text style={styles.text}>Hello Swiper</Text>
        </View>

        <View style={styles.slide2}>
          <Text style={styles.text}>Beautiful</Text>
        </View>

        <View style={styles.slide3}>
          <Text style={styles.text}>And simple</Text>
        </View>
      </Swiper>
    );
  }
}

AppRegistry.registerComponent('swiper', () => Swiper);

Properties

PropDefaultTypeDescription
index0numberIndex number of initial slide.
pagertruebooleanShow pager.
onPageChangefunctionCallback when page changes.
activeDotColorbluestringCSS color of the dot for the current page.
threshold25numberThreshold before the swiper captures the pan responder
disableLastSwipefalsebooleanDisable Swipe effect on start and end page
ref``stringGive Reference to Swiper to use changePage method
method
PropparamsTypeDescription
changePageindexfunctionChange To Particular Page. Usage this.refs.swiper.changePage(index);

Examples

See code in examples.

Keywords

FAQs

Package last updated on 18 Sep 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