Skip to main content
Vuetify0 is now in alpha!
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

useTimer API

API reference for the useTimer composable.

Explore these related pages for additional context and usage patterns.

PageCategory
useTimerSystem
useRafSystem
createQueueRegistration

Functions

useTimer

(handler: () => void, options?: TimerOptions) => TimerContext

Creates a reactive timer with pause/resume support.

Options

duration

MaybeRefOrGetter<number> | undefined

Duration in milliseconds. Accepts a plain number, ref, or getter — the value is read fresh each time `start()` is invoked, so reactive sources can change between runs without recreating the timer.

Default: 1000

repeat

boolean | undefined

Whether the timer repeats after firing.

Default: false

Properties

remaining

ShallowRef<number>

Milliseconds left until next fire.

isActive

ShallowRef<boolean>

Whether the timer is currently active (started and not stopped).

isPaused

ShallowRef<boolean>

Whether the timer is currently paused.

Methods

start

() => void

Start the timer. Restarts if already running.

stop

() => void

Stop the timer and reset remaining to full duration.

pause

() => void

Pause the timer, preserving remaining time. No-op if not running.

resume

() => void

Resume from where pause left off. No-op if not paused.

Was this page helpful?

Ctrl+/