New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-js-app-tutorial

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-js-app-tutorial

A library for React Native to build a tutorial intro

0.2.1
latest
Source
npm
Version published
Weekly downloads
4
300%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-js-app-tutorial

A library for React Native to build a tutorial intro.

Getting started

$ yarn add react-native-js-app-tutorial

Usage

react-native-js-app-tutorial has ready templates to show pages. You can import Slide, a template prepared to show a slide with a default style. If you prefer, you can provide your own template. Just make sure that it belongs to IntroSlider component (as child).

Stepper

You can also override the default skip button, passing a skipButton prop to IntroSlider.

/* @flow */

import React, { Component } from 'react';
import { StyleSheet } from 'react-native';
import { IntroSlider, Slide } from 'react-native-js-app-tutorial';

type Props = {
  navigator: Object
};

class Example extends Component<Props> {
  _onSkip = () => {
    console.log('onSkip pressed');
  };

  render() {
    return (
      <IntroSlider
        onSkip={this._onSkip}
        activeDotStyle={styles.activeDot}
        showSkipButton={true}
        skipTitleButton="SKIP"
        skipLastTitleButton="NEXT"
        tintStatusBar={true}
        animationType={'Parallax'}>
        <Slide
          image={{
            uri:
              'https://images.pexels.com/photos/259600/pexels-photo-259600.jpeg?cs=srgb&dl=architecture-facade-house-259600.jpg&fm=jpg'
          }}
          title="Welcome"
          description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel mollis risus. Nam dignissim porttitor suscipit."
          backgroundColor="#FEBE29"
          titleStyle={styles.title}
          imageStyle={styles.image}
          descriptionStyle={styles.description}
        />
        <Slide
          image={{
            uri:
              'https://images.pexels.com/photos/259600/pexels-photo-259600.jpeg?cs=srgb&dl=architecture-facade-house-259600.jpg&fm=jpg'
          }}
          title="Welcome 2"
          description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel mollis risus. Nam dignissim porttitor suscipit."
          backgroundColor="#CD5C5C"
          titleStyle={styles.title}
          imageStyle={styles.image}
          descriptionStyle={styles.description}
        />
        <Slide
          image={{
            uri:
              'https://images.pexels.com/photos/259600/pexels-photo-259600.jpeg?cs=srgb&dl=architecture-facade-house-259600.jpg&fm=jpg'
          }}
          title="Welcome 3"
          description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel mollis risus. Nam dignissim porttitor suscipit."
          backgroundColor="#6495ED"
          titleStyle={styles.title}
          imageStyle={styles.image}
          descriptionStyle={styles.description}
        />
      </IntroSlider>
    );
  }
}

const styles = StyleSheet.create({
  activeDot: {
    backgroundColor: 'white'
  },
  title: {
    fontFamily: 'AvenirNext-Bold'
  },
  description: {
    fontFamily: 'Avenir Next'
  },
  image: {
    width: '80%',
    height: 200
  }
});

export default Example;

API

PropTypeRequiredDescription
pagenumberNoIndex of initial page that should be selected
onSkipFunctionNoFunction to execute when default skip button is pressed
activeDotStyleObjectNoStyles object of active dot at the bottom
inactiveDotStyleObjectNoStyles object of inactive dot at the bottom
skipTitleButtonstringNoTitle of the skip button
skipLastTitleButtonstringNoTitle of the skip button when last page is displayed
skipButtonReact.ElementNoDisplay a custom skip button component to override the default template
animationTypestringNoChoose a predefined animation to apply on ScrollView's children (default: Parallax, types: Parallax, Pager, ZoomOut, TranslateY, RotateX, RotateY, Flip & FadeIn)
customAnimationObjectNoCustom animation to apply on ScrollView's children

License

MIT License

Copyright (c) 2018 InterfaceKit

Author

Antonio Moreno Valls <amoreno at apsl.net>

Built with 💛 by APSL.

Keywords

react

FAQs

Package last updated on 13 Sep 2018

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