1.0.25 • Published 3 years ago
draxo-react-timer v1.0.25
Draxo React Timer
A simple React timer library for managing countdowns.
Installation
You can install with npm or yarn.
npm install draxo-react-timeryarn add draxo-react-timerUsage
import React from 'react';
import { useReactTimer } from 'draxo-react-timer';
const TimerExample = () => {
const { handleStopClick, handleStartClick, handleResetClick, time } =
useReactTimer({ hours: 0, mins: 1, segs: 0 });
return (
<div>
<button onClick={handleStopClick}>Stop</button>
<button onClick={handleStartClick}>Start</button>
<button onClick={handleResetClick}>Reset</button>
{time}
</div>
);
};
export default TimerExample;User guide
Props
| Prop name | Description | Type |
|---|---|---|
| hours | Add the hours for the timer. max 24 | number |
| mins | Add the mins for the timer. max 60 | number |
| segs | Add the segs for the timer. max 60 | number |
| isDecrement | Allows you to reverse the timer. | boolean |
1.0.25
3 years ago
1.0.24
3 years ago
1.0.23
3 years ago
1.0.22
3 years ago
1.0.21
3 years ago
1.0.20
3 years ago
1.0.19
3 years ago
1.0.18
3 years ago
1.0.17
3 years ago
1.0.16
3 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago