::: tip 📰 Recent updated functions :::
useInterval
— reactive counter increases on every intervaluseIntervalFn
— wrapper forsetInterval
with controlsuseNow
— reactive current Date instanceuseRafFn
— call function on everyrequestAnimationFrame
useTimeout
— update value after a given time with controlsuseTimeoutFn
— wrapper forsetTimeout
with controlsuseTimestamp
— reactive current timestampuseTransition
— transition between values
useBreakpoints
— reactive viewport breakpointsuseBrowserLocation
— reactive browser locationuseClipboard
— reactive Clipboard APIuseCssVar
— manipulate CSS variablesuseDark
— reactive dark mode with auto data persistenceuseEventListener
— use EventListener with easeuseFavicon
— reactive faviconuseFetch
— reactive Fetch API provides the ability to abort requestsuseFullscreen
— reactive Fullscreen APIuseMediaControls
— reactive media controls for bothaudio
andvideo
elementsuseMediaQuery
— reactive Media QueryusePermission
— reactive Permissions APIusePreferredColorScheme
— reactive prefers-color-scheme media queryusePreferredDark
— reactive dark theme preferenceusePreferredLanguages
— reactive Navigator LanguagesuseScriptTag
— script tag injectinguseShare
— reactive Web Share APIuseTitle
— reactive document titleuseUrlSearchParams
— reactive URLSearchParams
templateRef
— shorthand for binding ref to template elementtryOnMounted
— safeonMounted
tryOnUnmounted
— safeonUnmounted
unrefElement
— unref for dom elementuseVModel
— shorthand for v-model bindinguseVModels
— shorthand for props v-model binding
useTimeAgo
— reactive time ago
useEventSource
— an EventSource or Server-Sent-Events instance opens a persistent connection to an HTTP serveruseWebSocket
— reactive WebSocket clientuseWebWorker
— simple Web Workers registration and communicationuseWebWorkerFn
— run expensive function without blocking the UI
onClickOutside
— listen for clicks outside of an elementonKeyStroke
— listen for keyboard key being strokedonStartTyping
— fires when users start typing on non-editable elementsuseBattery
— reactive Battery Status APIuseDeviceLight
— reactive DeviceLightEventuseDeviceMotion
— reactive DeviceMotionEventuseDeviceOrientation
— reactive DeviceOrientationEventuseDevicePixelRatio
— reactively trackwindow.devicePixelRatio
useDocumentVisibility
— reactively trackdocument.visibilityState
useElementBounding
— reactive bounding box of an HTML elementuseElementSize
— reactive size of an HTML elementuseElementVisibility
— tracks the visibility of an element within the viewportuseGeolocation
— reactive Geolocation APIuseIdle
— tracks whether the user is being inactiveuseIntersectionObserver
— detects that a target element's visibilityuseMagicKeys
— reactive keys pressed stateuseMouse
— reactive mouse positionuseMouseInElement
— reactive mouse position related to an elementuseMousePressed
— reactive mouse pressing stateuseMutationObserver
— watch for changes being made to the DOM treeuseNetwork
— reactive Network statususeOnline
— reactive online stateusePageLeave
— reactive state to show whether the mouse leaves the pageuseParallax
— create parallax effect easilyuseResizeObserver
— reports changes to the dimensions of an Element's content or the border-boxuseSpeechRecognition
— reactive SpeechRecognitionuseSwipe
— reactive swipe detection based onTouchEvents
useWindowScroll
— reactive window scrolluseWindowSize
— reactive window size
createGlobalState
— keep states in the global scope to be reusable across Vue instancesuseLocalStorage
— reactive LocalStorageuseSessionStorage
— reactive SessionStorageuseStorage
— reactive LocalStorage/SessionStorage
asyncComputed
— computed for async functionsbiSyncRef
— two-way refs synchronizationcontrolledComputed
— explicitly define the deps of computedcontrolledRef
— fine-grained controls over ref and its reactivityextendRef
— add extra attributes to Refget
— shorthand for accessingref.value
makeDestructurable
— make isomorphic destructurable for object and array at the same timereactify
— converts plain functions into reactive functionsreactifyObject
— applyreactify
to an objectreactivePick
— reactively pick fields from a reactive objectset
— shorthand forref.value = x
syncRef
— keep target refs in sync with a source refuseAsyncState
— reactive async stateuseCounter
— basic counter with utility functionsuseDebounce
— debounce execution of a ref valueuseDebounceFn
— debounce execution of a functionuseManualRefHistory
— manually track the change history of a ref when the using callscommit()
useRefHistory
— track the change history of a refuseThrottle
— throttle changing of a ref valueuseThrottleFn
— throttle execution of a functionuseToggle
— a boolean switcher with utility functions
debouncedWatch
— debounced watchignorableWatch
— ignorable watchpausableWatch
— pausable watchthrottledWatch
— throttled watchuntil
— promised one-time watch for changeswatchWithFilter
—watch
with additional EventFilter controlwhenever
— shorthand for watching value to be truthy
More functions avaliable in Add-ons.