react-input-time

npm Build Status Coverage Status

A simple, yet customizable, React component for time selection.

Install

Requires React 16.8 or later

npm install --save react-input-time

or

yarn add react-input-time

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import TimeInput from 'react-input-time';

const App = () => (
  <TimeInput
    className="input-time"
    initialTime="13:37"
    onChange={(event, value) => {}}
  />
);

ReactDOM.render(<App />, document.querySelector('.app'));

Options

  • initialTime: The initial time value, required.
  • input: A custom <input> element to use instead of the default one.
  • onChange: onChange handler, will be passed the new value and the complete SyntheticEvent object.

All other props will be passed straight through to the rendered DOM element.

Acknowledgments

Originally based on logic from https://github.com/dima-bu/react-input-time, but heavily stripped down.

Last updated

v2.0.0

Install

npm install react-input-time
yarn add react-input-time

BUNDLE SIZE

Not Available

DOWNLOAD TIME

Not Available

CDNs

extras

Contributors

  • jwilsson