GithubHelp home page GithubHelp logo

pepe-ves / react-native-simple-stepper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from testshallpass/react-native-simple-stepper

0.0 1.0 0.0 8.52 MB

A super simple react-native implementation of the UIStepper control from iOS.

License: MIT License

JavaScript 77.61% Python 5.19% Java 3.98% Objective-C 13.22%

react-native-simple-stepper's Introduction

react-native-simple-stepper

Platform npm version npm version Build Status codecov License

screenshot screenshot screenshot screenshot

A super simple react-native implementation of the UIStepper control from iOS.

Table of contents

  1. Installation
  2. Demo
  3. Usage
  4. Props

Installation

npm i react-native-simple-stepper --save

Usage

import SimpleStepper from 'react-native-simple-stepper'
//...
render() {
  return (
    <SimpleStepper valueChanged={(value) => this.valueChanged(value)} />
  )
}
valueChanged(value) {
  // If you want to set the value to a certain decimal point you can like so:
  const displayValue = value.toFixed(2)
  this.setState({
     displayValue: displayValue
  })
  // ...
}
//...

Demo

screenshot

Props

Name Type Description Default
initialValue Number initial value 0
minimumValue Number minimum value 0
maximumValue Number maximum value 10
stepValue Number step value (i.e. increment by 10) 1
backgroundColor String background color transparent
tintColor String color for border, divider and images blue
padding Number stepper padding 4
valueChanged Function Fires when the value changes and the value will be passed down for processing like display or calculations null
incrementImage String or Number network or local image require('./assets/increment.png')
decrementImage String or Number network or local image require('./assets/decrement.png')
tintOnIncrementImage Boolean whether or not you want tintColor applied to increment image true
tintOnDecrementImage Boolean whether or not you want tintColor applied to decrement image true
imageHeight Number network image height 36
imageWidth Number network image width 36
activeOpacity Number touch opacity 0.4
disabledOpacity Number when step button is disabled 0.5
disabled Boolean stepper disable state false
wraps Boolean whether or not it wraps. more info false
renderIncrement Function render increment component(s) null
renderDecrement Function render decrement component(s) null

react-native-simple-stepper's People

Contributors

testshallpass avatar dev-two avatar iroachie avatar

Watchers

James Cloos 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.