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

useDelay API

API reference for the useDelay composable.

Explore these related pages for additional context and usage patterns.

PageCategory
useDelaySystem
useTimerSystem
usePopoverSystem

Functions

useDelay

(callback?: ((isOpening: boolean) => void) | undefined, options?: UseDelayOptions) => UseDelayReturn

Schedule open and close transitions with configurable delays. Composes `useTimer` for the lifecycle (`start` / `stop` / `pause` / `resume` plus reactive `isActive`, `isPaused`, `remaining`) and adds direction tracking (`isOpening`) and promise-based resolution.

Options

openDelay

MaybeRefOrGetter<number> | undefined

Delay in milliseconds before the opening transition fires.

closeDelay

MaybeRefOrGetter<number> | undefined

Delay in milliseconds before the closing transition fires.

Properties

isActive

Readonly<Ref<boolean, boolean>>

Whether a delay is currently pending (started, not stopped).

isPaused

Readonly<Ref<boolean, boolean>>

Whether the pending delay is currently paused.

remaining

Readonly<Ref<number, number>>

Milliseconds remaining until the pending transition fires.

isOpening

Readonly<Ref<boolean, boolean>>

Direction of the pending transition (`true` = opening, `false` = closing).

Methods

start

(isOpening: boolean, options?: UseDelayStartOptions) => Promise<boolean>

Start a delay in the given direction. Restarts if already running. Resolves with `isOpening` once the delay elapses. If `start()` is called again before the previous resolves, the previous promise resolves with the new direction.

stop

() => void

Cancel any pending delay and reset state. Resolves the pending promise with the current direction.

pause

() => void

Pause the in-flight delay, 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+/