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

react-native-stepper-counter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-stepper-counter

A super simple react-native implementation Stepper.If you have any thought of implementing Add To cart something like E-commerce apps or Food Apps, just give a try

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-simple-stepper

Platform npm version npm version Build Status codecov License

A super simple react-native implementation of the UIStepper control from iOS with added customization and flexibility.

Table of contents

  1. Installation
  2. Usage
  3. 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.
    const nextValue = Number(value.toFixed(2));
    this.setState({ value: nextValue });
    // ...
  }
  render() {
    return <SimpleStepper valueChanged={value => this.valueChanged(value)} />;
  }
}

Props

Values

NameTypeDescriptionDefault
initialValueNumberinitial value0
minimumValueNumberminimum value0
maximumValueNumbermaximum value10
stepValueNumberstep value (ex. increment by 10)1
incrementImageString or Numbernetwork or local imagerequire('./assets/increment.png')
decrementImageString or Numbernetwork or local imagerequire('./assets/decrement.png')
activeOpacityNumbertouch opacity0.4
disabledOpacityNumberwhen step button is disabled0.5
disabledBooleanstepper disable statefalse
wrapsBooleanwhether or not it wraps. more infofalse
showTextBooleanwhether or not to show text componentfalse
textPositionStringplacement of the text componentcenter

Functions

NameTypeDescriptionDefault
valueChangedFunctioninvoked when value changes() => {}
onMinFunctioninvoked when value reaches min value() => {}
onMaxFunctioninvoked when value reaches min value() => {}
onIncrementFunctioninvoked each time value increments() => {}
onDecrementFunctioninvoked each time value decrements() => {}
renderDecrementImageFunctionused to override decrement image componentundefined
renderIncrementImageFunctionused to override increment image componentundefined
renderDecrementStepFunctionused to override decrement step componentundefined
renderIncrementStepFunctionused to override increment step componentundefined
renderTextFunctionused to override increment text componentundefined

Styles

NameTypeDescriptionDefault
textStyleObjecttext component style{ padding: 8, fontSize: 20, fontWeight: 'bold', color: 'blue' }
containerStyleObjectcontainer component style{ backgroundColor: 'transparent', flexDirection: 'row', borderWidth: 2, borderRadius: 8, overflow: 'hidden', alignItems: 'center', borderColor: 'blue' }
separatorStyleObjectseparator component style{ width: StyleSheet.hairlineWidth, backgroundColor: 'blue', height: '100%' }
incrementStepStyleObjectincrement step component style{ padding: 8 }
decrementStepStyleObjectdecrement step component style{ padding: 8 }
incrementImageStyleObjectincrement image component styles{ height: 36, width: 36 }
decrementImageStyleObjectdecrement image component styles{ height: 36, width: 36 }

Keywords

FAQs

Package last updated on 31 Aug 2019

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