Skip to main content
You are viewing Pre-Alpha documentation.
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.

Functions

useTimer

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

Creates a reactive timer with pause/resume support.

Options

duration

number | undefined

Duration in milliseconds.

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?

© 2016-1970 Vuetify, LLC
Ctrl+/