Skip to content

Commit 3d7f65c

Browse files
authored
Merge pull request #26 from flurmbo/readme
Readme
2 parents 006f510 + 88ed815 commit 3d7f65c

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
React duration picker for mobile, inspired by Android number pickers. A live demo is available [here](https://flurmbo.github.io/react-duration-picker).
1+
React duration picker for mobile, inspired by Android number pickers. A live demo is available [here](https://flurmbo.github.io/react-duration-picker). Supports keyboard and mouse events in addition to touch. A type declaration file is also included.
22

33
# Installation
44

5-
Currently you'll have to clone the repository yourself from Github. The project will be added to the npm registry in the near future.
5+
`npm install react-duration-picker`
66

7-
# Usage
7+
Then in your React component:
8+
9+
`import DurationPicker from 'react-duration-picker'`
10+
11+
# API
12+
13+
| Prop | Type | Default | Description |
14+
| --------------- | ----------------------------------------------------------- | ---------------------------------- | -------------------------------------------------------------------------------------------- |
15+
| onChange | ({hours: number, minutes: number, seconds: number}) => void | () => {} | Callback executed by DurationPicker whenever the duration displayed on the picker is updated |
16+
| initialDuration | {hours: number, minutes: number, seconds: number} | {hours: 0, minutes: 0, seconds: 0} | Duration to display on first render |
17+
| maxHours | number | 10 | Max number of hours that can be selected |
18+
19+
# Example
820

921
```javascript
1022
const onChange = duration => {
@@ -24,6 +36,8 @@ return (
2436
);
2537
```
2638

39+
The `example` directory contains the code for the demo.
40+
2741
# Contributing
2842

2943
Contributions and feedback are welcome. Submit bugs or suggestions as an [issue](https://github.com/flurmbo/react-duration-picker/issues) on Github.

0 commit comments

Comments
 (0)