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

react-native-simple-stepper

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-simple-stepper

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

  • 2.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
38
decreased by-58.24%
Maintainers
1
Weekly downloads
 
Created
Source

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 OR yarn add react-native-simple-stepper

Usage


import React, { Component } from 'react';
import { SimpleStepper } from 'react-native-simple-stepper';

export default class App extends Component {
  constructor(props) {
    super(props);
    this.state = { value: 0 };
  }
  valueChanged(value) {
    // Truncate value to 2 decimal places and cast as Number (like the demo).
    const nextValue = Number(value.toFixed(2));
    this.setState({ value: nextValue });
    // ...
  }
  render() {
    const { value } = this.state;
    return <SimpleStepper value={value} valueChanged={value => this.valueChanged(value)} />;
  }
}

Demo

screenshot

Props

NameTypeDescriptionDefault
valueNumberstepper's value0
initialValueNumberinitial value0
minimumValueNumberminimum value0
maximumValueNumbermaximum value10
stepValueNumberstep value (i.e. increment by 10)1
backgroundColorStringbackground colortransparent
tintColorStringcolor for border, divider and imagesblue
paddingNumberstepper padding4
valueChangedFunctionFires when the value changes and the value will be passed down for processing like display or calculationsnull
incrementImageString or Numbernetwork or local imagerequire('./assets/increment.png')
decrementImageString or Numbernetwork or local imagerequire('./assets/decrement.png')
tintOnIncrementImageBooleanwhether or not you want tintColor applied to increment imagetrue
tintOnDecrementImageBooleanwhether or not you want tintColor applied to decrement imagetrue
imageHeightNumbernetwork image height36
imageWidthNumbernetwork image width36
activeOpacityNumbertouch opacity0.4
disabledOpacityNumberwhen step button is disabled0.5
disabledBooleanstepper disable statefalse
wrapsBooleanwhether or not it wraps. more infofalse
renderIncrementFunctionrender increment component(s)null
renderDecrementFunctionrender decrement component(s)null

Keywords

FAQs

Package last updated on 31 Dec 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

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