Description
vue-timer-hook is a small set of Vue 3 composition API hooks for countdowns, stopwatches and live clocks. useTimer counts down to an expiry timestamp given in milliseconds since the Unix epoch, and returns the remaining days, hours, minutes and seconds as reactive values. It also has start, pause, resume and restart controls. useStopwatch counts up from an optional starting offset in seconds. useTime gives the current local time in 12-hour or 24-hour format. The hooks return reactive refs such as isRunning and isExpired, so templates update automatically. The library needs Vue 3.2 or later as a peer dependency. The project is open source on GitHub, and its README includes a live demo and tables that describe each option and return value. It is inspired by the react-timer-hook library.…
Highlights
- Countdown hook with pause, resume and restart
- Stopwatch hook counting up from an offset
- Live clock hook in 12-hour or 24-hour format
- Reactive refs for use in templates
- Needs Vue 3.2 or later
Ratings & Reviews
No ratings yet
Be the first to rate vue-timer-hook.
People also visit
vue-timer-hook FAQ
What is vue-timer-hook?
A set of Vue 3 composition hooks for timers, stopwatches and a live clock, for developers building Vue components.
Which Vue version does it need?
Vue 3.2 or later, installed as a peer dependency. It is built for the Vue 3 composition API.
How does the countdown take its end time?
You pass expiryTimestamp as a number of milliseconds since the Unix epoch, the same value Date.now() returns.
Is it free to use?
It is open source and the repository is public on GitHub. The page shown does not state the licence, so check the repository before you use it.
What are the best vue-timer-hook alternatives?
Popular alternatives to vue-timer-hook include vue3-count-to, @leenguyen/react-flip-clock-countdown and vue-3-slider-component. See all vue-timer-hook alternatives




















