A React hook for creating and managing timers with start, pause, reset, and callback functionality.
use-timer is a React hook that provides a simple and flexible way to manage timers in functional components. It solves the problem of handling timer logic—like starting, pausing, resetting, and tracking elapsed time—without manual setInterval or setTimeout management. The hook supports both incremental and decremental timers with configurable options and callbacks.
React developers building applications that require timers, such as countdowns, stopwatches, quizzes, or any time-based UI interactions.
Developers choose use-timer for its minimal API, zero dependencies, and ease of integration—reducing timer-related boilerplate while offering features like callback support, status tracking, and flexible configuration out of the box.
A timer hook for React
With a minimal bundle size and zero dependencies, use-timer adds negligible overhead, as shown by its small gzip size on BundlePhobia.
Supports both incremental and decremental timers with configurable intervals, steps, and end times, allowing for diverse timer types from countdowns to stopwatches.
Provides simple methods like start, pause, reset, and advanceTime, reducing boilerplate code for common timer operations, as demonstrated in the basic usage examples.
Includes onTimeUpdate and onTimeOver callbacks for event handling, along with real-time status (RUNNING, PAUSED, STOPPED) for easy UI integration.
As a React-specific hook, it cannot be used in other JavaScript frameworks or vanilla JS projects, restricting its applicability.
Lacks support for lap times, splits, or dynamic interval adjustments, which are essential for more complex timer applications like multi-stage stopwatches.
Relies on setInterval which can accumulate timing errors over long periods, making it less reliable for precise, long-running timers without manual corrections.
📋 React Hooks for form state management and validation (Web + React Native)
React Hooks — 👍
Use immer to drive state with a React hooks
Web. Components. 😂
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.