GithubHelp home page GithubHelp logo

attrash-islam / input-number Goto Github PK

View Code? Open in Web Editor NEW

This project forked from react-component/input-number

0.0 1.0 0.0 4.21 MB

React Input Number

Home Page: http://react-component.github.io/input-number/

License: MIT License

CSS 3.42% JavaScript 96.58%

input-number's Introduction

rc-input-number


input number ui component for react

NPM version build status Test coverage gemnasium deps node version npm download

Screenshots

install

rc-input-number

Usage

var InputNumber = require('rc-input-number');
var React = require('react');
var ReactDOM = require('react-dom');
ReactDOM.render(<InputNumber defaultValue={19}/>, container);

Development

npm install
npm start

Example

http://127.0.0.1:8000/examples/

online example: http://react-component.github.io/input-number/examples/

API

props

name type default description
min Number Specifies the minimum value
onClick
placeholder string
max Number Specifies the maximum value
step Number or String 1 Specifies the legal number intervals
precision Number Specifies the precision length of value
disabled Boolean false Specifies that an InputNumber should be disabled
focusOnUpDown Boolean true whether focus input when click up or down button
required Boolean false Specifies that an InputNumber is required
autoFocus Boolean false Specifies that an InputNumber should automatically get focus when the page loads
readOnly Boolean false Specifies that an InputNumber is read only
name String Specifies the name of an InputNumber
id String Specifies the id of an InputNumber
value Number Specifies the value of an InputNumber
defaultValue Number Specifies the defaultValue of an InputNumber
onChange Function Called when value of an InputNumber changed
onFocus Function Called when an element gets focus
style Object root style. such as {width:100}
upHandler React.Node custom the up step element
downHandler React.Node custom the down step element
formatter (value: number|string): displayValue: string Specifies the format of the value presented
parser (displayValue: string) => value: number `input => input.replace(/[^\w\.-]*/g, '')` Specifies the value extracted from formatter

Keyboard Navigation

  • When you hit the or key, the input value will be increased or decreased by step
  • With the Shift key (Shift+⬆, Shift+⬇), the input value will be changed by 10 * step
  • With the Ctrl or key (Ctrl+⬆ or ⌘+⬆ or Ctrl+⬇ or ⌘+⬇ ), the input value will be changed by 0.1 * step

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-input-number is released under the MIT license.

input-number's People

Contributors

afc163 avatar benjycui avatar chrisfan avatar colinvdh avatar eatong avatar hfiguiere avatar jiramew avatar jpagand avatar jwilkes90 avatar minsungryu avatar nearimba avatar paranoidjk avatar pines-cheng avatar silentcloud avatar tsj1107 avatar weihong1028 avatar yesmeck avatar yiminghe avatar

Watchers

 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.