Simple React time input field

Simple React time input field

Simple React time input field.


Simple React time input field.



npm install --save react-simple-timefield

#for React <16 use: npm install --save [email protected]


import TimeField from 'react-simple-timefield';
    value={time}                     // {String}   required, format '00:00' or '00:00:00'
    onChange={(value) => {...}}      // {Function} required
    input={<MyCustomInputElement />} // {Element}  default: <input type="text" />
    colon=":"                        // {String}   default: ":"
    showSeconds                      // {Boolean}  default: false

Real world example

import TimeField from 'react-simple-timefield';

class App extends React.Component {
  constructor(...args) {

    this.state = {
      time: '12:34'

    this.onTimeChange = this.onTimeChange.bind(this);

  onTimeChange(time) {

  render() {
    const {time} = this.state;

    return (
      <TimeField value={time} onChange={this.onTimeChange} />

Run demo:

For running demo locally, replace:

import TimeField from '../';
// to
import TimeField from '../src';

in demo/index.js file.

# run development mode
cd demo
npm run dev


npm test
npm run format
npm run build


  • Support full time format with seconds
  • Tests
  • Custom input field (like Material UI TextField)
  • Custom colon
  • Support for Date object as value

Download Details:

Author: antonfisher

Official Website:

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

ReactJS vs Angular vs Vue: Best Javascript Framework For Your Project

ReactJS vs Angular vs Vue: Best Javascript Framework For Your Project. This video covers the key differences between ReactJS, Angular and Vue with respect to the following: Use case, Performance, Data binding, Scripting language, Testing, Community support, Growth curve

What is JavaScript – All You Need To Know About JavaScript

In this article on what is JavaScript, we will learn the basic concepts of JavaScript.

JavaScript Tutorial: if-else Statement in JavaScript

This JavaScript tutorial is a step by step guide on JavaScript If Else Statements. Learn how to use If Else in javascript and also JavaScript If Else Statements. if-else Statement in JavaScript. JavaScript's conditional statements: if; if-else; nested-if; if-else-if. These statements allow you to control the flow of your program's execution based upon conditions known only during run time.