1.0.1 • Published 5 years ago

react-native-number-view v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

React Native Number View

image1

This is a simple React Native number counter component.

Installation

Add react-native-number-view to your project by executing

$  npm install react-native-number-view
or
$ yarn add react-native-number-view

and that's it, you're all good to go!

Usage

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, {Component} from 'react';
import {View} from 'react-native';
import {NumberView} from 'react-native-number-view'
 
type Props = {};
export default class App extends Component<Props> {
  render() {
    return (
      <View style={styles.container}>
          <NumberView
            enableDefaultStyles={true}
            themeColor="#3F6D2A"
            leftContent={<Text>😔</Text>}
            rightContent={<Text>😃</Text>}
            onValueChange={(newVal)=>{alert(newVal)}}
            onDecrement={()=>{alert('decremented')}}
            onIncrement={()=>{alert('Incremented')}}
          />
      </View>
    );
  }
}

API's

NameUseDefault Values
leftContentContent to be displayed on the leftNone
rightContentContent to be displayed on the RightNone
onValueChangeCallback which return new valueNone
onDecrementcallback each time value is decrementedNone
onIncrementcallback each time value is incrementedNone
themeColorUse to set a theme color(only accepts HEX)none
enableDefaultStyles (boolean)enable or disable preset stylesTrue
initialValuecounters initial value0

Contributions

What to help make this package even more awesome? Read how to contribute

Licensing

This project is licensed under MIT license.

Don't forget to star, like and share :)