Gathering detailed insights and metrics for react-countdown-hook
Gathering detailed insights and metrics for react-countdown-hook
Gathering detailed insights and metrics for react-countdown-hook
Gathering detailed insights and metrics for react-countdown-hook
react-timer-hook
React timer hook is a custom react hook built to handle timers(countdown), stopwatch and time logic/state in your react component.
use-countdown-react
Countdown react hook
reactjs-countdown-hook
a simple count down timer hook for react with formatting
react-hook-final-countdown
countdown hook for react functional components
Dead simple yet powerful countdown hook for React.
npm install react-countdown-hook
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
75 Stars
105 Commits
20 Forks
1 Watchers
4 Branches
4 Contributors
Updated on May 31, 2025
Latest Version
1.1.3
Package Id
react-countdown-hook@1.1.3
Unpacked Size
26.78 kB
Size
4.40 kB
File Count
11
NPM Version
8.12.1
Node Version
18.4.0
Published on
Mar 13, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Dead simple yet powerful countdown hook for React. Powered by requestAnimationFrame
.
Using npm:
1$ npm install --save react-countdown-hook
Using yarn:
1$ yarn add react-countdown-hook
1import React from 'react'; 2import useCountDown from 'react-countdown-hook'; 3 4const initialTime = 60 * 1000; // initial time in milliseconds, defaults to 60000 5const interval = 1000; // interval to change remaining time amount, defaults to 1000 6 7const render = () => { 8 const [timeLeft, { start, pause, resume, reset }] = useCountDown(initialTime, interval); 9 10 // start the timer during the first render 11 React.useEffect(() => { 12 start(); 13 }, []); 14 15 const restart = React.useCallback(() => { 16 // you can start existing timer with an arbitrary value 17 // if new value is not passed timer will start with initial value 18 const newTime = 42 * 1000; 19 start(newTime); 20 }, []); 21 22 return ( 23 <> 24 <p>Time left: {timeLeft}</p> 25 26 <button onClick={restart}> 27 Restart counter with 42 seconds 28 </button> 29 </> 30 ); 31}
Note that this is a very basic usage. Check out more usage examples in playground or in the demo project
Takes a default countdown time and interval time.
timeToCount
{Number
} Time in milliseconds that countdown should start with. Defaults to 60000
interval
{Number
} Time in milliseconds representing the frequency that countdown should update with. Defaults to 1000
Returns an array with remaining time and actions object.
timeLeft
{Number
} Remaining countdown time in millisecondsactions.start
{Function
} Start or restart a countdown. Takes time in milliseconds to start with.actions.reset
{Function
} Resets a countdown to initial stateactions.pause
{Function
} Pauses a countdownactions.resume
{Function
} Resumes a paused countdownFeel free to submit any issues or pull requests.
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/2 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
56 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More