Giter Site home page Giter Site logo

josipreh / react-native-js-stepper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from interfacekit/react-native-js-stepper

0.0 0.0 1.0 116 KB

React Native component to display a Stepper, a sequence of logical and numbered steps, frequently used for navigation.

License: MIT License

JavaScript 100.00%

react-native-js-stepper's Introduction

react-native-js-stepper

React Native component to display a Stepper, a sequence of logical and numbered steps, frequently used for navigation.

See more on:

https://material.io/guidelines/components/steppers.html

Stepper

Getting started

$ yarn add react-native-js-stepper

Usage

/* @flow */

import React from 'react'
import { StyleSheet } from 'react-native'
import Stepper from 'react-native-js-stepper'

type Props = {}

export default class ViewScreen extends React.Component<Props> {
  render() {
    return (
      <Stepper
        ref={(ref: any) => {
          this.stepper = ref
        }}
        validation={false}
        activeDotStyle={styles.activeDot}
        inactiveDotStyle={styles.inactiveDot}
        showTopStepper={true}
        showBottomStepper={true}
        steps={['Step 1', 'Step 2']}
        backButtonTitle="BACK"
        nextButtonTitle="NEXT"
        activeStepStyle={styles.activeStep}
        inactiveStepStyle={styles.inactiveStep}
        activeStepTitleStyle={styles.activeStepTitle}
        inactiveStepTitleStyle={styles.inactiveStepTitle}
        activeStepNumberStyle={styles.activeStepNumber}
        inactiveStepNumberStyle={styles.inactiveStepNumber}>
        <View />
        <View />
      </Stepper>
    )
  }
}

const styles = StyleSheet.create({
  activeDot: {
    backgroundColor: 'grey'
  },
  inactiveDot: {
    backgroundColor: '#ededed'
  },
  activeStep: {
    backgroundColor: 'grey'
  },
  inactiveStep: {
    backgroundColor: '#ededed'
  },
  activeStepTitle: {
    fontWeight: 'bold'
  },
  inactiveStepTitle: {
    fontWeight: 'normal'
  },
  activeStepNumber: {
    color: 'white'
  },
  inactiveStepNumber: {
    color: 'black'
  }
})

API

Props Type Description Required
initialPage number Index of initial page that should be selected No
onPressNext Function Function executed when Next button is pressed at the bottom No
onPressBack Function Function executed when Back button is pressed at the bottom No
onScrollPage Function Function executed when page is changed by scroll event No
textButtonStyle Object Text styles of the Back and Next buttons at the bottom No
backButtonTitle string Title of the Back button No
nextButtonTitle string Title of the Next button No
topStepperStyle Object Styles of the top stepper No
showTopStepper boolean If true shows the top stepper No
activeDotStyle Object Styles object of active dot at the bottom No
inactiveDotStyle Object Styles object of inactive dot at the bottom No
steps Array Array of strings that contains title of each step on the top stepper No
stepsTitleStyle Object Styles object for title of each step at top No
showBottomStepper boolean If true shows bottom stepper No
activeStepNumberStyle Object Styles object of number on active step No
inactiveStepNumberStyle Object Styles object of number on inactive step No
activeStepTitleStyle Object Styles object of title on active step No
inactiveStepTitleStyle Object Styles object of title on inactive step No
validation boolean Disables validation (related to top stepper numbers) No

License

MIT License

Copyright (c) 2018 InterfaceKit

Author

Antonio Moreno Valls <amoreno at apsl.net>

Built with ๐Ÿ’› by APSL.

react-native-js-stepper's People

Contributors

alvaromb avatar josipreh avatar

Forkers

thelazydev

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.