1.0.0 • Published 6 years ago

@5rabbits/time-input v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@5rabbits/time-input npm Travis Codecov

A time input in 00h 00m format.

Usage

  • Install with yarn add @5rabbits/time-input.
  • Install peer dependencies (if you haven't already) yarn add react@^16.0.0 react-dom@^16.0.0. React 15 is also supported.
  • Use the component:
import TimeInput from '@5rabbits/time-input'

<TimeInput />

Demo

Props

proptypedefaultrequireddescription
clearablebooltrueIf true the input can be emptied (notifying value null). If false when the user tries to clear the text it will be set to 0.
defaultValuenumberThe initial value in minutes to use as an uncontrolled input.
onChangefuncCallback that will be invoked when the value changes. The first argument will be the new value in minutes.
valuenumberThe value in minutes to use as a controlled input.

Development

  • Run yarn start to start building the library in watch mode.
  • Write stories in the stories/index.js file.
  • Run yarn publish to release a new version.

This project lints and prettifies source files automatically before commiting.