Google Keep app inspired time picker for react :clock4:
Time picker based on the style of the Android Google Keep app.
Features
$ yarn add react-timekeeper
# or via npm
$ 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
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.
For full api and examples, see API docs and examples
nvm use v12.16.0
(or anything >12+)yarn install
yarn add -P react react-dom
npm run docs:dev
localhost:3002
Before submitting a PR, ensure that:
npm run tests
npm run docs:build
npm run lib
Other useful commands:
npm version NEW_VERSION
, commit and push - CI should publish to npm automatically