Git Product home page Git Product logo

react-keyboard-time-input's Introduction

react-keyboard-time-input

Build Status codecov

PeerDependencies Dependencies DevDependencies

Forked from alanclarke/time-input.

A keyboard friendly react component for capturing time.

DEMO HERE

Features

  • supports react 16
  • supports es6 and commonjs modules
  • small UI surface area (just a form input)
  • keyboard friendly (can type times, use up and down keys to go forwards and backwards in time, can tab between time groups)
  • simple api (infers most options from value, e.g. 24hr time or 12hr, whether to display seconds and milliseconds)
  • easy going UX: ignores invalid input and simply skips over separator if omitted
  • no dependencies
  • 95% test coverage

Installation

yarn add react-keyboard-time-input

or

npm install react-keyboard-time-input

Usage

import ReactDom from 'ReactDom';
import TimeInput from 'react-keyboard-time-input';

function render (value) {
  ReactDom.render((
    <TimeInput value={value} onChange={render}/>
  ), document.body)
}

render()

Valid formats

/*
 * '12:00'
 * '12:00 AM'
 * '12:00:00'
 * '12:00:00:000 AM'
*/

Run tests

npm test

react-keyboard-time-input's People

Contributors

alanclarke avatar mattliving avatar radumardale avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.