2.0.1 • Published 7 years ago

@chickendinosaur/react-ui-numeric-input v2.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

React numeric input textfield.

Built to be as a PureComponent and to be as customizable as possible without defaulting to inline styles.


Getting Started

Installation

npm

npm install @chickendinosaur/react-ui-numeric-input

Usage

import NumericInput from '@chickendinosaur/react-ui-numeric-input';

React.render(
  <NumericInput
    value="1"
    min={-1}
    max={1}
    step={0.1}
    precision={1}
    wrap={true}
    onChange={(value) => {
      console.log(value);
    }}
  />,
  document.getElementById('body')
);

Props

NameTypeDefault
valuenumber or string or nullnull
defaultValuenumbernull
minnumberNumber.MIN_SAFE_INTEGER
maxnumberNumber.MAX_SAFE_INTEGER
precisionnumber0
stepnumber1
stepDelaynumber500
stepSpeednumber100
clampbooleantrue
wrapbooleanfalse
disabledbooleanfalse
textfieldDisabledbooleanfalse
classNamestringnull
styleobjectnull
btnStyleobjectnull
textfieldStyleobjectnull
onChangefunctionnull

Styling

  • Each internal component has a style prop that can be overridden via inline style objects.
  • CSS can be overridden by passing the component a new class to mit's className prop and overwriting it's immediate children CSS selectors.

Features

  • Hold button to auto increase or decrease value by step.

Development

Installation

Storybook

  • npm run storybook

Build

  • npm run build

Benchmarking

  • npm run benchmark

Test

  • npm run test

License

The MIT License (MIT)

Copyright (c) 2016 John Pittman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

2.0.1

7 years ago

2.0.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago