react-simple-timefield
Simple React time input field.
Demo
Installation
npm install --save react-simple-timefield
Usage example
import TimeField from 'react-simple-timefield';
class App extends React.Component {
constructor(...args) {
super(...args);
this.state = {
time: '12:34'
};
this.onTimeChange = this.onTimeChange.bind(this);
}
onTimeChange(time) {
this.setState({time});
}
render() {
const {time} = this.state;
return (
<section>
<TimeField value={time} onChange={this.onTimeChange} />
<TimeField value={time} onChange={this.onTimeChange} style={{color: '#333'}}/>
</section>
);
}
}
ES5 version: const TimeField = require('react-simple-timefield/dist)'
;
Contributing
cd demo
npm run dev
cd demo
npm run build
npm run build
npm run lint
Todo
License
MIT License. Free use and change.