Giter Site home page Giter Site logo

linecode / react-timekeeper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from catc/react-timekeeper

0.0 2.0 0.0 1.94 MB

Google Keep app inspired time picker for react :clock4:

Home Page: https://catc.github.io/react-timekeeper

License: MIT License

JavaScript 10.10% TypeScript 89.90%

react-timekeeper's Introduction


React Timekeeper

build downloads license

Time picker based on the style of the Android Google Keep app.


Features

  • supports both 12 hour and 24 hour mode, and flexible time formats
  • simple to use with many customizable options
  • smooth, beautiful animations with react spring
  • typescript support

Installation

$ npm install --save react-timekeeper

Version 2+ of timekeeper requires react hooks (v16.8). If you're using an older version of react, install timekeeper v1 via

$ npm install --save react-timekeeper@^1.0.0

Usage

import React, {useState} from 'react';
import TimeKeeper from 'react-timekeeper';

function YourComponent(){
  const [time, setTime] = useState('12:34pm')

  return (
    <div>
      <TimeKeeper
        time={time}
        onChange={(data) => setTime(data.formatted12)}
      />
      <span>Time is {time}</span>
    </div>
  )
}

All styles are inlined via emotion so no css imports are required.

API

For full api and examples, see API docs and examples

Development

  1. Clone the repo
  2. nvm use v10.16.0 (or anything >10)
  3. npm install
  4. npm run docs:dev
  5. Navigate to localhost:3002

Contributing

Before submitting a PR, ensure that:

  1. you follow all eslint rules (should be automatic)
  2. all tests pass via npm run tests
  3. everything builds
    • docs - npm run docs:build
    • lib - npm run lib
  4. provide detailed info on what bug you're fixing or feature you're adding - if possible include a screenshot/gif

Other useful commands:

  • build docs: npm run docs:build
  • run all tests: npm run tests
  • watch tests: npm run tests:watch
  • create lib to publish npm: npm run lib

react-timekeeper's People

Contributors

arjunkomath avatar catc avatar dulcehc avatar enobrev avatar heinst avatar keevan avatar lex111 avatar oatycreates avatar rickeyward avatar russmax783 avatar

Watchers

 avatar  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.