react-input-time
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

react-input-time

npm build 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) => {}}
  />
);

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 a 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-time-input, but heavily stripped down.

Readme

Keywords

none

Package Sidebar

Install

npm i react-input-time

Weekly Downloads

35

Version

3.0.0

License

MIT

Unpacked Size

13.5 kB

Total Files

9

Last publish

Collaborators

  • jwilsson