url
stringlengths
24
106
html
stringlengths
41
53k
title
stringlengths
0
63
https://vueuse.org/core/useBattery/
useBattery ​ Category Sensors Export Size 743 B Last Changed 2 months ago Reactive Battery Status API, more often referred to as the Battery API, provides information about the system's battery charge level and lets you be notified by events that are sent when the battery level or charging status change. This can be u...
useBattery | VueUse
https://vueuse.org/core/onLongPress/
onLongPress ​ Category Sensors Export Size 675 B Last Changed 3 weeks ago Listen for a long press on an element. Function provides modifiers in options stop once prevent capture self Demo ​ source Long Pressed: false Press long (500ms)Press long (1000ms)Reset Usage ​ html <script setup lang="ts"> import { ref } f...
onLongPress | VueUse
https://vueuse.org/core/onKeyStroke/
onKeyStroke ​ Category Sensors Export Size 651 B Last Changed 3 weeks ago Listen for keyboard keystrokes. Demo ​ source Use the arrow keys or w a s d keys to control the movement of the ball. Repeated events are ignored on the key `d` or `->`. Usage ​ js import { onKeyStroke } from '@vueuse/core' onKeyStroke('Ar...
onKeyStroke | VueUse
https://vueuse.org/core/useWebWorker/
useWebWorker ​ Category Browser Export Size 322 B Last Changed 6 months ago Related useWebWorkerFn Simple Web Workers registration and communication. Usage ​ js import { useWebWorker } from '@vueuse/core' const { data, post, terminate, worker } = useWebWorker('/path/to/worker.js') State Type Description data Ref<any...
useWebWorker | VueUse
https://vueuse.org/core/useWebWorkerFn/
useWebWorkerFn ​ Category Browser Export Size 749 B Last Changed 2 months ago Related useWebWorker Run expensive functions without blocking the UI, using a simple syntax that makes use of Promise. A port of alewin/useWorker. Demo ​ source Current Time: 2023-11-28 22:16:47 888 This is a demo showing sort for large ...
useWebWorkerFn | VueUse
https://vueuse.org/core/useWebNotification/
useWebNotification ​ Category Browser Export Size 964 B Last Changed 2 months ago Reactive Notification The Web Notification interface of the Notifications API is used to configure and display desktop notifications to the user. Demo ​ source Supported: true Show Notification Usage ​ ts const { isSupported, no...
useWebNotification | VueUse
https://vueuse.org/core/onClickOutside/
onClickOutside ​ Category Sensors Export Size 893 B Last Changed 3 weeks ago Listen for clicks outside of an element. Useful for modal or dropdown. Demo ​ source Open ModalToggle Dropdown Usage ​ html <template> <div ref="target"> Hello world </div> <div> Outside element </div> </template> <script>...
onClickOutside | VueUse
https://vueuse.org/core/useWakeLock/
useWakeLock ​ Category Browser Export Size 727 B Last Changed 8 months ago Reactive Screen Wake Lock API. Provides a way to prevent devices from dimming or locking the screen when an application needs to keep running. Demo ​ source Is Supported: true Is Active: false ON Usage ​ js import { useWakeLock } from '@vueu...
useWakeLock | VueUse
https://vueuse.org/core/useVibrate/
useVibrate ​ Category Browser Export Size 671 B Last Changed 8 months ago Reactive Vibration API Most modern mobile devices include vibration hardware, which lets software code provides physical feedback to the user by causing the device to shake. The Vibration API offers Web apps the ability to access this hardware...
useVibrate | VueUse
https://vueuse.org/core/useUrlSearchParams/?foo=bar&vueuse=awesome
useUrlSearchParams ​ Category Browser Export Size 1.59 kB Last Changed last year Reactive URLSearchParams Demo ​ source foo=bar vueuse=awesome Usage ​ js import { useUrlSearchParams } from '@vueuse/core' const params = useUrlSearchParams('history') console.log(params.foo) // 'bar' params.foo = 'bar' params.vueus...
useUrlSearchParams | VueUse
https://vueuse.org/core/useTitle/
useTitle ​ Category Browser Export Size 903 B Last Changed 8 months ago Reactive document title. TIP When using with Nuxt 3, this function will NOT be auto imported in favor of Nuxt's built-in useTitle(). Use explicit import if you want to use the function from VueUse. Demo ​ source Title Usage ​ js import { useT...
useTitle | VueUse
https://vueuse.org/core/useTextDirection/
useTextDirection ​ Category Browser Export Size 821 B Last Changed last year Reactive dir of the element's text. Demo ​ source This paragraph is in English and correctly goes left to right. LTRClick to change the direction Usage ​ ts import { useTextDirection } from '@vueuse/core' const dir = useTextDirection() /...
useTextDirection | VueUse
https://vueuse.org/core/useStyleTag/
useStyleTag ​ Category Browser Export Size 474 B Last Changed 3 weeks ago Inject reactive style element in head. Demo ​ source Edit CSS: LoadUnload ID: vueuse_styletag_1 Loaded: true Usage ​ Basic usage ​ Provide a CSS string, then useStyleTag will automatically generate an id and inject it in <head>. js impor...
useStyleTag | VueUse
https://vueuse.org/core/useTextareaAutosize/
useTextareaAutosize ​ Category Browser Export Size 869 B Last Changed 6 months ago Automatically update the height of a textarea depending on the content. Demo ​ source Type, the textarea will grow: Usage ​ vue <script setup lang="ts"> const { textarea, input } = useTextareaAutosize() </script> <template> <texta...
useTextareaAutosize | VueUse
https://vueuse.org/core/useShare/
useShare ​ Category Browser Export Size 546 B Last Changed 8 months ago Reactive Web Share API. The Browser provides features that can share content in text or file. The share method has to be called following a user gesture like a button click. It can’t simply be called on page load for example. That’s in place to h...
useShare | VueUse
https://vueuse.org/core/useScriptTag/
useScriptTag ​ Category Browser Export Size 676 B Last Changed 8 months ago Creates a script tag, with support for automatically unloading (deleting) the script tag on unmount. If a script tag already exists for the given URL, useScriptTag() will not create another script tag, but keep in mind that depending on how y...
useScriptTag | VueUse
https://vueuse.org/core/useScreenSafeArea/
useScreenSafeArea ​ Category Browser Export Size 1.5 kB Last Changed 2 years ago Reactive env(safe-area-inset-*) Demo ​ source top: right: bottom: left: Usage ​ In order to make the page to be fully rendered in the screen, the additional attribute viewport-fit=cover within viewport meta tag must be set firstly, th...
useScreenSafeArea | VueUse
https://vueuse.org/core/useScreenOrientation/
useScreenOrientation ​ Category Browser Export Size 704 B Last Changed 3 months ago Reactive Screen Orientation API. It provides web developers with information about the user's current screen orientation. Demo ​ source For best results, please use a mobile or tablet device (or use your browser's native inspector t...
useScreenOrientation | VueUse
https://vueuse.org/core/usePreferredReducedMotion/
usePreferredReducedMotion ​ Category Browser Export Size 557 B Last Changed last year Reactive prefers-reduced-motion media query. Demo ​ source Preferred Motion: no-preference Usage ​ js import { usePreferredReducedMotion } from '@vueuse/core' const preferredMotion = usePreferredReducedMotion() Component Usage ​ ...
usePreferredReducedMotion | VueUse
https://vueuse.org/core/usePreferredLanguages/
usePreferredLanguages ​ Category Browser Export Size 537 B Last Changed 2 years ago Reactive Navigator Languages. It provides web developers with information about the user's preferred languages. For example, this may be useful to adjust the language of the user interface based on the user's preferred languages in ord...
usePreferredLanguages | VueUse
https://vueuse.org/core/usePreferredDark/
usePreferredDark ​ Category Browser Export Size 536 B Last Changed 2 years ago Related useColorMode useDark Reactive dark theme preference. Demo ​ source Prefers Dark: true Usage ​ js import { usePreferredDark } from '@vueuse/core' const isDark = usePreferredDark() Component Usage ​ This function also provides a ...
usePreferredDark | VueUse
https://vueuse.org/core/usePreferredColorScheme/
usePreferredColorScheme ​ Category Browser Export Size 570 B Last Changed 2 years ago Reactive prefers-color-scheme media query. Demo ​ source Preferred Color Scheme: dark Usage ​ js import { usePreferredColorScheme } from '@vueuse/core' const preferredColor = usePreferredColorScheme() Component Usage ​ This func...
usePreferredColorScheme | VueUse
https://vueuse.org/core/usePreferredContrast/
usePreferredContrast ​ Category Browser Export Size 583 B Last Changed last year Reactive prefers-contrast media query. Demo ​ source Preferred contrast: no-preference Usage ​ js import { usePreferredContrast } from '@vueuse/core' const preferredContrast = usePreferredContrast() Component Usage ​ This function al...
usePreferredContrast | VueUse
https://vueuse.org/core/usePermission/
usePermission ​ Category Browser Export Size 759 B Last Changed last year Related useUserMedia Reactive Permissions API. The Permissions API provides the tools to allow developers to implement a better user experience as far as permissions are concerned. Demo ​ source accelerometer: prompt accessibilityEvents: prom...
usePermission | VueUse
https://vueuse.org/core/usePerformanceObserver/
usePerformanceObserver ​ Category Browser Export Size 536 B Last Changed 9 months ago Observe performance metrics. Demo ​ source refresh [] Usage ​ TypeScript ts import { usePerformanceObserver } from '@vueuse/core' const entrys = ref<PerformanceEntry[]>([]) usePerformanceObserver( { entryTypes: ['paint'], ...
usePerformanceObserver | VueUse
https://vueuse.org/core/useObjectUrl/
useObjectUrl ​ Category Browser Export Size 278 B Last Changed 4 months ago Reactive URL representing an object. Creates an URL for the provided File, Blob, or MediaSource via URL.createObjectURL() and automatically releases the URL via URL.revokeObjectURL() when the source changes or the component is unmounted. Dem...
useObjectUrl | VueUse
https://vueuse.org/core/useMemory/
useMemory ​ Category Browser Export Size 524 B Last Changed last year Reactive Memory Info. Demo ​ source Your browser does not support performance memory API Usage ​ ts import { useMemory } from '@vueuse/core' const { isSupported, memory } = useMemory() Source ​ Source • Demo • Docs Contributors ​ Anthony Fu Je...
useMemory | VueUse
https://vueuse.org/core/useMediaControls/
useMediaControls ​ Category Browser Export Size 2.41 kB Last Changed 2 months ago Reactive media controls for both audio and video elements Demo ​ source 00:00 00:00 / 14:48 Off English French Enter Picture in Picture Loop 2x 1x currentTime: 0 duration: 888.035 waiting: false seeking: false ended: false stalled: fa...
useMediaControls | VueUse
https://vueuse.org/core/useMediaQuery/
useMediaQuery ​ Category Browser Export Size 505 B Last Changed 4 months ago Reactive Media Query. Once you've created a MediaQueryList object, you can check the result of the query or receive notifications when the result changes. Demo ​ source isLargeScreen: true prefersDark: true Usage ​ js import { useMediaQue...
useMediaQuery | VueUse
https://vueuse.org/core/useGamepad/
useGamepad ​ Category Browser Export Size 1.25 kB Last Changed 6 months ago Provides reactive bindings for the Gamepad API. Demo ​ source Gamepad is not supported on this device. It seems your device does not support the Gamepad API. Check here for a list supported devices. Usage ​ Due to how the Gamepad API works...
useGamepad | VueUse
https://vueuse.org/core/useImage/
useImage ​ Category Browser Export Size 1.39 kB Last Changed 2 months ago Reactive load an image in the browser, you can wait the result to display it or show a fallback. Demo ​ source Loading... ChangeCreate Error Usage ​ html <script setup> import { useImage } from '@vueuse/core' const avatarUrl = 'https://place...
useImage | VueUse
https://vueuse.org/core/useFullscreen/
useFullscreen ​ Category Browser Export Size 1.05 kB Last Changed 2 months ago Reactive Fullscreen API. It adds methods to present a specific Element (and its descendants) in full-screen mode, and to exit full-screen mode once it is no longer needed. This makes it possible to present desired content—such as an online ...
useFullscreen | VueUse
https://vueuse.org/core/usefilesystemaccess/
useFileSystemAccess ​ Category Browser Export Size 878 B Last Changed 2 months ago Create and read and write local files with FileSystemAccessAPI Demo ​ source Open New file Save Save as DataType Text ArrayBuffer Blob isSupported: true fileName: '' fileMIME: '' fileSize: 0 fileLastModified: 0 Usage ​ ts import { u...
useFileSystemAccess | VueUse
https://vueuse.org/core/useFileDialog/
useFileDialog ​ Category Browser Export Size 707 B Last Changed 3 weeks ago Open file dialog with ease. Demo ​ source Choose filesReset Usage ​ TypeScript ts import { useFileDialog } from '@vueuse/core' const { files, open, reset, onChange } = useFileDialog({ accept: 'image/*', // Set to accept only image files ...
useFileDialog | VueUse
https://vueuse.org/core/useFavicon/
useFavicon ​ Category Browser Export Size 362 B Last Changed 2 months ago Reactive favicon Demo ​ source Change favicon to VueVueUse Usage ​ js import { useFavicon } from '@vueuse/core' const icon = useFavicon() icon.value = 'dark.png' // change current icon Passing a source ref ​ You can pass a ref to it, chang...
useFavicon | VueUse
https://vueuse.org/core/useEyeDropper/
useEyeDropper ​ Category Browser Export Size 314 B Last Changed 2 months ago Reactive EyeDropper API Demo ​ source isSupported: true sRGBHex: Open Eye Dropper Usage ​ ts import { useEyeDropper } from '@vueuse/core' const { isSupported, open, sRGBHex } = useEyeDropper() Component Usage ​ This function also provide...
useEyeDropper | VueUse
https://vueuse.org/core/useDark/
useDark ​ Category Browser Export Size 3.03 kB Last Changed 7 months ago Related useColorMode usePreferredDark useStorage Reactive dark mode with auto data persistence. Learn useDark with this FREE video lesson from Vue School! Demo ​ source Dark Basic Usage ​ js import { useDark, useToggle } from '@vueuse/core' c...
useDark | VueUse
https://vueuse.org/core/useCssVar/
useCssVar ​ Category Browser Export Size 820 B Last Changed 6 months ago Manipulate CSS variables Demo ​ source Sample text, #7fa998 Change Color Sample text, --color: #7fa998 Change Color Variable Usage ​ js import { useCssVar } from '@vueuse/core' const el = ref(null) const color1 = useCssVar('--color', el) con...
useCssVar | VueUse
https://vueuse.org/core/useColorMode/
useColorMode ​ Category Browser Export Size 2.89 kB Last Changed 2 months ago Related useDark usePreferredDark useStorage Reactive color mode (dark / light / customs) with auto data persistence. Demo ​ source Auto← Click to change the color mode Basic Usage ​ js import { useColorMode } from '@vueuse/core' const mo...
useColorMode | VueUse
https://vueuse.org/core/useEventListener/
useEventListener ​ Category Browser Export Size 467 B Last Changed 3 months ago Use EventListener with ease. Register using addEventListener on mounted, and removeEventListener automatically on unmounted. Usage ​ js import { useEventListener } from '@vueuse/core' useEventListener(document, 'visibilitychange', (evt) ...
useEventListener | VueUse
https://vueuse.org/core/useClipboardItems/
useClipboardItems ​ Category Browser Export Size Last Changed 3 weeks ago Related useClipboard Reactive Clipboard API. Provides the ability to respond to clipboard commands (cut, copy, and paste) as well as to asynchronously read from and write to the system clipboard. Access to the contents of the clipboard is gated ...
useClipboardItems | VueUse
https://vueuse.org/core/useClipboard/
useClipboard ​ Category Browser Export Size 1.02 kB Last Changed 3 weeks ago Related useClipboardItems Reactive Clipboard API. Provides the ability to respond to clipboard commands (cut, copy, and paste) as well as to asynchronously read from and write to the system clipboard. Access to the contents of the clipboard i...
useClipboard | VueUse
https://vueuse.org/core/useBrowserLocation/
useBrowserLocation ​ Category Browser Export Size 952 B Last Changed 2 months ago Reactive browser location NOTE: If you're using Vue Router, use useRoute provided by Vue Router instead. Demo ​ source Input and hash will be changed: trigger: 'load' state: null length: 4 origin: 'https://vueuse.org' hash: '' host: ...
useBrowserLocation | VueUse
https://vueuse.org/core/useBroadcastChannel/
useBroadcastChannel ​ Category Browser Export Size 476 B Last Changed 8 months ago Reactive BroadcastChannel API. Closes a broadcast channel automatically component unmounted. Demo ​ source Supported: true Please open this page in at least two tabs Send Message Usage ​ The BroadcastChannel interface represents ...
useBroadcastChannel | VueUse
https://vueuse.org/core/useBluetooth/
useBluetooth ​ Category Browser Export Size 596 B Last Changed 2 months ago Reactive Web Bluetooth API. Provides the ability to connect and interact with Bluetooth Low Energy peripherals. The Web Bluetooth API lets websites discover and communicate with devices over the Bluetooth 4 wireless standard using the Generic...
useBluetooth | VueUse
https://vueuse.org/core/useBreakpoints/
useBreakpoints ​ Category Browser Export Size 915 B Last Changed 2 months ago Reactive viewport breakpoints. Demo ​ source Current breakpoints: [ "sm", "md", "lg", "xl", "2xl" ] xs(<640px): false xs(<=640px): false sm: false md: false lg: false xl: false 2xl: true Usage ​ js import { breakpointsTailwind, useBreakpo...
useBreakpoints | VueUse
https://vueuse.org/core/useWindowSize/
useWindowSize ​ Category Elements Export Size 964 B Last Changed 4 months ago Reactive window size Demo ​ source 1680 x 1050 Usage ​ js import { useWindowSize } from '@vueuse/core' const { width, height } = useWindowSize() Component Usage ​ This function also provides a renderless component version via the @vueu...
useWindowSize | VueUse
https://vueuse.org/core/useWindowScroll/
useWindowScroll ​ Category Elements Export Size 555 B Last Changed 3 weeks ago Reactive window scroll Demo ​ source See scroll values in the lower right corner of the screen. Scroll value x: 0 y: 0 scroll Xscroll Y Usage ​ js import { useWindowScroll } from '@vueuse/core' const { x, y } = useWindowScroll() console...
useWindowScroll | VueUse
https://vueuse.org/core/useWindowFocus/
useWindowFocus ​ Category Elements Export Size 532 B Last Changed 2 months ago Reactively track window focus with window.onfocus and window.onblur events. Demo ​ source 💡 Click somewhere outside of the document to unfocus. Usage ​ js import { useWindowFocus } from '@vueuse/core' const focused = useWindowFocus() C...
useWindowFocus | VueUse
https://vueuse.org/core/useResizeObserver/
useResizeObserver ​ Category Elements Export Size 671 B Last Changed 2 months ago Reports changes to the dimensions of an Element's content or the border-box Demo ​ source Resize the box to see changes Usage ​ html <template> <div ref="el"> {{text}} </div> </template> <script> import { ref } from 'vue' imp...
useResizeObserver | VueUse
https://vueuse.org/core/useParentElement/
useParentElement ​ Category Elements Export Size 496 B Last Changed 8 months ago Get parent element of the given element Usage ​ When no argument is passed, it will return the parent element of the current component. js import { useParentElement } from '@vueuse/core' const parentEl = useParentElement() onMounted(...
useParentElement | VueUse
https://vueuse.org/core/useMutationObserver/
useMutationObserver ​ Category Elements Export Size 613 B Last Changed 3 weeks ago Watch for changes being made to the DOM tree. MutationObserver MDN Demo ​ source Usage ​ ts import { ref } from 'vue' import { useMutationObserver } from '@vueuse/core' export default { setup() { const el = ref(null) const...
useMutationObserver | VueUse
https://vueuse.org/core/usemouseinelement/
useMouseInElement ​ Category Elements Export Size 1.12 kB Last Changed last week Reactive mouse position related to an element Demo ​ source Hover me x: 0 y: 0 sourceType: null elementX: 0 elementY: 0 elementPositionX: 0 elementPositionY: 0 elementHeight: 0 elementWidth: 0 isOutside: true Usage ​ html <template> ...
useMouseInElement | VueUse
https://vueuse.org/core/useIntersectionObserver/
useIntersectionObserver ​ Category Elements Export Size 634 B Last Changed 8 months ago Detects that a target element's visibility. Demo ​ source Enable Scroll me down! Hello world! Element outside the viewport Usage ​ html <div ref="target"> <h1>Hello world</h1> </div> js import { ref } from 'vue' import { us...
useIntersectionObserver | VueUse
https://vueuse.org/core/useelementvisibility/
useElementVisibility ​ Category Elements Export Size 692 B Last Changed 2 months ago Tracks the visibility of an element within the viewport. Demo ​ source Info on the right bottom corner Target Element (scroll down) Element inside the viewport Usage ​ html <template> <div ref="target"> <h1>Hello world</h1> ...
useElementVisibility | VueUse
https://vueuse.org/core/useElementSize/
useElementSize ​ Category Elements Export Size 955 B Last Changed 3 weeks ago Reactive size of an HTML element. ResizeObserver MDN Demo ​ source Resize the box to see changes Usage ​ html <template> <div ref="el"> Height: {{ height }} Width: {{ width }} </div> </template> <script> import { ref } from '...
useElementSize | VueUse
https://vueuse.org/core/useElementBounding/
useElementBounding ​ Category Elements Export Size 1.15 kB Last Changed last year Reactive bounding box of an HTML element Demo ​ source Resize the box to see changes Usage ​ html <template> <div ref="el" /> </template> <script> import { ref } from 'vue' import { useElementBounding } from '@vueuse/core' export ...
useElementBounding | VueUse
https://vueuse.org/core/useDropZone/
useDropZone ​ Category Elements Export Size 629 B Last Changed 3 weeks ago Create a zone where files can be dropped. Demo ​ source Drop files on to drop zones PNG SVG General DropZone isOverDropZone: false Image DropZone isOverDropZone: false Usage ​ html <script setup lang="ts"> import { useDropZone } from '@vueu...
useDropZone | VueUse
https://vueuse.org/core/useDraggable/
useDraggable ​ Category Elements Export Size 1.36 kB Last Changed 3 weeks ago Make elements draggable. Demo ​ source Check the floating boxes 👋 Drag me! I am at 400, 80 Renderless component Position persisted in sessionStorage 431, 150 👋 Drag here! Handle that triggers the drag event I am at 467, 240 Usage ​ htm...
useDraggable | VueUse
https://vueuse.org/core/useDocumentVisibility/
useDocumentVisibility ​ Category Elements Export Size 542 B Last Changed 2 months ago Reactively track document.visibilityState Demo ​ source 💡 Minimize the page or switch tab then return Usage ​ js import { useDocumentVisibility } from '@vueuse/core' const visibility = useDocumentVisibility() Component Usage ​ ...
useDocumentVisibility | VueUse
https://vueuse.org/core/useActiveElement/
useActiveElement ​ Category Elements Export Size 712 B Last Changed 4 months ago Reactive document.activeElement Demo ​ source Select the inputs below to see the changes Current Active Element: null Usage ​ js import { useActiveElement } from '@vueuse/core' const activeElement = useActiveElement() watch(activeEle...
useActiveElement | VueUse
https://vueuse.org/core/useThrottledRefHistory/
useThrottledRefHistory ​ Category State Export Size 1.73 kB Last Changed last year Related useDebouncedRefHistory useRefHistory Shorthand for useRefHistory with throttled filter. Demo ​ source Count: 0 IncrementDecrement/UndoRedo Delay (in ms): History (limited to 10 records for demo) 2023-11-28 22:16:19{ value:...
useThrottledRefHistory | VueUse
https://vueuse.org/core/useStorageAsync/
useStorageAsync ​ Category State Export Size 1.63 kB Last Changed 8 months ago Related useStorage Reactive Storage in with async support. Usage ​ Please refer to useStorage Source ​ Source • Docs Contributors ​ Anthony Fu Jelf 丶远方 Wu Rui ntnyq Waldi Andreas Weber Changelog ​ v10.0.0-beta.5 on 4/13/2023 cb644 - re...
useStorageAsync | VueUse
https://vueuse.org/core/usesessionstorage/
useSessionStorage ​ Category State Export Size 2.03 kB Last Changed 7 months ago Related useStorage Reactive SessionStorage. Usage ​ Please refer to useStorage Source ​ Source • Docs Contributors ​ Anthony Fu Antério Vieira ntnyq Jelf Shinigami Pig Fang Alex Kozack Changelog ​ v10.0.0-beta.4 on 4/13/2023 4d757 - ...
useSessionStorage | VueUse
https://vueuse.org/core/useStorage/
useStorage ​ Category State Export Size 1.99 kB Last Changed 3 weeks ago Related useColorMode useDark useLocalStorage useSessionStorage useStorageAsync Reactive LocalStorage/SessionStorage Demo ​ source name: 'Banana' color: 'Yellow' size: 'Medium' count: 0 Usage ​ TIP When using with Nuxt 3, this functions will...
useStorage | VueUse
https://vueuse.org/core/useManualRefHistory/
useManualRefHistory ​ Category State Export Size 516 B Last Changed 4 months ago Related useRefHistory Manually track the change history of a ref when the using calls commit(), also provides undo and redo functionality Demo ​ source Count: 0 IncrementDecrement/CommitUndoRedo History (limited to 10 records for dem...
useManualRefHistory | VueUse
https://vueuse.org/core/useRefHistory/
useRefHistory ​ Category State Export Size 1.45 kB Last Changed last year Related useDebouncedRefHistory useManualRefHistory useThrottledRefHistory Track the change history of a ref, also provides undo and redo functionality Learn useRefHistory with this FREE video lesson from Vue School! Demo ​ source Count: 0 Inc...
useRefHistory | VueUse
https://vueuse.org/core/usedebouncedrefhistory/
useDebouncedRefHistory ​ Category State Export Size 1.7 kB Last Changed 8 months ago Related useRefHistory useThrottledRefHistory Shorthand for useRefHistory with debounced filter. Demo ​ source Count: 0 IncrementDecrement/UndoRedo Delay (in ms): History (limited to 10 records for demo) 2023-11-28 22:16:15{ valu...
useDebouncedRefHistory | VueUse
https://vueuse.org/core/useLocalStorage/
useLocalStorage ​ Category State Export Size 2.02 kB Last Changed 8 months ago Related useStorage Reactive LocalStorage. Usage ​ Please refer to useStorage Source ​ Source • Docs Contributors ​ Anthony Fu Antério Vieira ntnyq Jelf Shinigami Pig Fang Alex Kozack Changelog ​ v10.0.0-beta.4 on 4/13/2023 4d757 - feat...
useLocalStorage | VueUse
https://vueuse.org/core/useAsyncState/
useAsyncState ​ Category State Export Size 1.17 kB Last Changed 7 months ago Reactive async state. Will not block your setup function and will trigger changes once the promise is ready. The state is a shallowRef by default. Demo ​ source Ready: false Loading: true {} Execute Usage ​ ts import axios from 'axios' im...
useAsyncState | VueUse
https://vueuse.org/shared/useArrayFindIndex/#VPContent
useArrayFindIndex ​ Category Array Export Size 136 B Last Changed 2 months ago Reactive Array.findIndex Usage ​ Use with array of multiple refs ​ js import { useArrayFindIndex } from '@vueuse/core' const item1 = ref(0) const item2 = ref(2) const item3 = ref(4) const item4 = ref(6) const item5 = ref(8) const list = [...
useArrayFindIndex | VueUse
https://vueuse.org/shared/useArrayIncludes/#VPContent
useArrayIncludes ​ Category Array Export Size 340 B Last Changed 2 months ago Reactive Array.includes Usage ​ Use with reactive array ​ js import { useArrayIncludes } from '@vueuse/core' const list = ref([0, 2, 4, 6, 8]) const result = useArrayIncludes(list, 10) // result.value: false list.value.push(10) // result.v...
useArrayIncludes | VueUse
https://vueuse.org/shared/usearrayfindlast/#VPContent
useArrayFindLast ​ Category Array Export Size 191 B Last Changed 2 months ago Reactive Array.findLast. Usage ​ js import { useArrayFindLast } from '@vueuse/core' const list = [ref(1), ref(-1), ref(2)] const positive = useArrayFindLast(list, val => val > 0) // positive.value: 2 Use with reactive array ​ js import { u...
useArrayFindLast | VueUse
https://vueuse.org/shared/useArrayFind/#VPContent
useArrayFind ​ Category Array Export Size 137 B Last Changed 2 months ago Reactive Array.find. Usage ​ js import { useArrayFind } from '@vueuse/core' const list = [ref(1), ref(-1), ref(2)] const positive = useArrayFind(list, val => val > 0) // positive.value: 1 Use with reactive array ​ js import { useArrayFind } fr...
useArrayFind | VueUse
https://vueuse.org/shared/useArrayFilter/#VPContent
useArrayFilter ​ Category Array Export Size 132 B Last Changed 2 months ago Reactive Array.filter Usage ​ Use with array of multiple refs ​ js import { useArrayFilter } from '@vueuse/core' const item1 = ref(0) const item2 = ref(2) const item3 = ref(4) const item4 = ref(6) const item5 = ref(8) const list = [item1, it...
useArrayFilter | VueUse
https://vueuse.org/shared/useThrottleFn/#VPContent
useThrottleFn ​ Category Utilities Export Size 401 B Last Changed 2 months ago Related refDebounced refThrottled useDebounceFn Throttle execution of a function. Especially useful for rate limiting execution of handlers on events like resize and scroll. Throttle is a spring that throws balls: after a ball flies out it...
useThrottleFn | VueUse
https://vueuse.org/shared/createEventHook/#VPContent
createEventHook ​ Category Utilities Export Size 212 B Last Changed 3 weeks ago Utility for creating event hooks Usage ​ Creating a function that uses createEventHook TypeScript ts import { createEventHook } from '@vueuse/core' export function useMyFetch(url) { const fetchResult = createEventHook<Response>() co...
createEventHook | VueUse
https://vueuse.org/shared/useDateFormat/#VPContent
useDateFormat ​ Category Time Export Size 807 B Last Changed 3 weeks ago Get the formatted date according to the string of tokens passed in, inspired by dayjs. List of all available formats (HH:mm:ss by default): Format Output Description Yo 2018th Ordinal formatted year YY 18 Two-digit year YYYY 2018 Four-digit yea...
useDateFormat | VueUse
https://vueuse.org/shared/useArrayUnique/#VPContent
useArrayUnique ​ Category Array Export Size 215 B Last Changed 2 months ago reactive unique array Usage ​ Use with array of multiple refs ​ js import { useArrayUnique } from '@vueuse/core' const item1 = ref(0) const item2 = ref(1) const item3 = ref(1) const item4 = ref(2) const item5 = ref(3) const list = [item1, it...
useArrayUnique | VueUse
https://vueuse.org/shared/useArrayJoin/
useArrayJoin ​ Category Array Export Size 137 B Last Changed 2 months ago Reactive Array.join Usage ​ Use with array of multiple refs ​ js import { useArrayJoin } from '@vueuse/core' const item1 = ref('foo') const item2 = ref(0) const item3 = ref({ prop: 'val' }) const list = [item1, item2, item3] const result = use...
useArrayJoin | VueUse
https://vueuse.org/shared/useArrayMap/
useArrayMap ​ Category Array Export Size 133 B Last Changed 2 months ago Reactive Array.map Usage ​ Use with array of multiple refs ​ js import { useArrayMap } from '@vueuse/core' const item1 = ref(0) const item2 = ref(2) const item3 = ref(4) const item4 = ref(6) const item5 = ref(8) const list = [item1, item2, item...
useArrayMap | VueUse
https://vueuse.org/shared/usearrayincludes/
useArrayIncludes ​ Category Array Export Size 340 B Last Changed 2 months ago Reactive Array.includes Usage ​ Use with reactive array ​ js import { useArrayIncludes } from '@vueuse/core' const list = ref([0, 2, 4, 6, 8]) const result = useArrayIncludes(list, 10) // result.value: false list.value.push(10) // result.v...
useArrayIncludes | VueUse
https://vueuse.org/shared/usearrayfindlast/
useArrayFindLast ​ Category Array Export Size 191 B Last Changed 2 months ago Reactive Array.findLast. Usage ​ js import { useArrayFindLast } from '@vueuse/core' const list = [ref(1), ref(-1), ref(2)] const positive = useArrayFindLast(list, val => val > 0) // positive.value: 2 Use with reactive array ​ js import { u...
useArrayFindLast | VueUse
https://vueuse.org/shared/usearrayfindindex/
useArrayFindIndex ​ Category Array Export Size 136 B Last Changed 2 months ago Reactive Array.findIndex Usage ​ Use with array of multiple refs ​ js import { useArrayFindIndex } from '@vueuse/core' const item1 = ref(0) const item2 = ref(2) const item3 = ref(4) const item4 = ref(6) const item5 = ref(8) const list = [...
useArrayFindIndex | VueUse
https://vueuse.org/shared/usearrayfind/
useArrayFind ​ Category Array Export Size 137 B Last Changed 2 months ago Reactive Array.find. Usage ​ js import { useArrayFind } from '@vueuse/core' const list = [ref(1), ref(-1), ref(2)] const positive = useArrayFind(list, val => val > 0) // positive.value: 1 Use with reactive array ​ js import { useArrayFind } fr...
useArrayFind | VueUse
https://vueuse.org/shared/usearrayfilter/
useArrayFilter ​ Category Array Export Size 132 B Last Changed 2 months ago Reactive Array.filter Usage ​ Use with array of multiple refs ​ js import { useArrayFilter } from '@vueuse/core' const item1 = ref(0) const item2 = ref(2) const item3 = ref(4) const item4 = ref(6) const item5 = ref(8) const list = [item1, it...
useArrayFilter | VueUse
https://vueuse.org/shared/useArrayEvery/#VPContent
useArrayEvery ​ Category Array Export Size 137 B Last Changed 2 months ago Reactive Array.every Usage ​ Use with array of multiple refs ​ js import { useArrayEvery } from '@vueuse/core' const item1 = ref(0) const item2 = ref(2) const item3 = ref(4) const item4 = ref(6) const item5 = ref(8) const list = [item1, item2...
useArrayEvery | VueUse
https://vueuse.org/shared/toValue/#VPContent
toValue ​ Category Reactivity Export Size 92 B Last Changed 8 months ago Alias resolveUnref Related toRef Get the value of value/ref/getter. Usage ​ ts import { toValue } from '@vueuse/core' const foo = ref('hi') const a = toValue(0) // 0 const b = toValue(foo) // 'hi' const c = toValue(() => 'hi') // 'hi' Source ​...
toValue | VueUse
https://vueuse.org/shared/useArrayDifference/#VPContent
useArrayDifference ​ Category Array Export Size 231 B Last Changed 2 months ago Reactive get array difference of two array Usage ​ Use with reactive array ​ js import { useArrayDifference } from '@vueuse/core' const list1 = ref([0, 1, 2, 3, 4, 5]) const list2 = ref([4, 5, 6]) const result = useArrayDifference(list1,...
useArrayDifference | VueUse
https://vueuse.org/shared/toRefs/#VPContent
toRefs ​ Category Reactivity Export Size 451 B Last Changed 4 months ago Extended toRefs that also accepts refs of an object. Usage ​ ts import { toRefs } from '@vueuse/core' import { reactive, ref } from 'vue' const objRef = ref({ a: 'a', b: 0 }) const arrRef = ref(['a', 0]) const { a, b } = toRefs(objRef) const [...
toRefs | VueUse
https://vueuse.org/shared/toReactive/#VPContent
toReactive ​ Category Reactivity Export Size 242 B Last Changed 4 months ago Converts ref to reactive. Also made possible to create a "swapable" reactive object. This function uses Proxy It is NOT supported by IE 11 or below. Usage ​ ts import { toReactive } from '@vueuse/core' const refState = ref({ foo: 'bar' })...
toReactive | VueUse
https://vueuse.org/shared/toRef/#VPContent
toRef ​ Category Reactivity Export Size 159 B Last Changed 8 months ago Alias resolveRef Related toValue Normalize value/ref/getter to ref or computed. Usage ​ ts import { toRef } from '@vueuse/core' const foo = ref('hi') const a = toRef(0) // Ref<number> const b = toRef(foo) // Ref<string> const c = toRef(() => 'h...
toRef | VueUse
https://vueuse.org/shared/syncRefs/#VPContent
syncRefs ​ Category Reactivity Export Size 158 B Last Changed 2 years ago Related syncRef Keep target refs in sync with a source ref Demo ​ source Usage ​ ts import { syncRefs } from '@vueuse/core' const source = ref('hello') const target = ref('target') const stop = syncRefs(source, target) console.log(target.v...
syncRefs | VueUse
https://vueuse.org/shared/reactiveOmit/#VPContent
reactiveOmit ​ Category Reactivity Export Size 381 B Last Changed 2 months ago Reactively omit fields from a reactive object. Usage ​ Basic Usage ​ ts import { reactiveOmit } from '@vueuse/core' const obj = reactive({ x: 0, y: 0, elementX: 0, elementY: 0, }) const picked = reactiveOmit(obj, 'x', 'elementX')...
reactiveOmit | VueUse
https://vueuse.org/shared/refDebounced/#VPContent
refDebounced ​ Category Reactivity Export Size 423 B Last Changed 8 months ago Alias useDebounce debouncedRef Related useThrottleFn Debounce execution of a ref value. Demo ​ source Delay is set to 1000ms for this demo. Debounced: Times Updated: 0 Usage ​ js import { refDebounced } from '@vueuse/core' const inpu...
refDebounced | VueUse
https://vueuse.org/shared/reactiveComputed/#VPContent
reactiveComputed ​ Category Reactivity Export Size 264 B Last Changed 4 months ago Computed reactive object. Instead of returning a ref that computed does, reactiveComputed returns a reactive object. This function uses Proxy It is NOT supported by IE 11 or below. Usage ​ ts import { reactiveComputed } from '@vueuse...
reactiveComputed | VueUse
https://vueuse.org/shared/reactifyObject/#VPContent
reactifyObject ​ Category Reactivity Export Size 305 B Last Changed 6 months ago Apply reactify to an object Usage ​ ts import { reactifyObject } from '@vueuse/core' const reactifiedConsole = reactifyObject(console) const a = ref('42') reactifiedConsole.log(a) // no longer need `.value` Source ​ Source • Docs Co...
reactifyObject | VueUse
https://vueuse.org/shared/computedWithControl/#VPContent
computedWithControl ​ Category Reactivity Export Size 250 B Last Changed 8 months ago Alias controlledComputed Related refWithControl Explicitly define the dependencies of computed. Usage ​ TypeScript ts import { computedWithControl } from '@vueuse/core' const source = ref('foo') const counter = ref(0) const computed...
computedWithControl | VueUse
https://vueuse.org/shared/watchWithFilter/#VPContent
watchWithFilter ​ Category Watch Export Size 373 B Last Changed last year watch with additional EventFilter control. Usage ​ Similar to watch, but offering an extra option eventFilter which will be applied to the callback function. ts import { debounceFilter, watchWithFilter } from '@vueuse/core' watchWithFilter( ...
watchWithFilter | VueUse
https://vueuse.org/shared/watchignorable/#VPContent
watchIgnorable ​ Category Watch Export Size 708 B Last Changed last year Alias ignorableWatch Ignorable watch Demo ​ source Value: 0 UpdateIgnored UpdateReset Log Usage ​ Extended watch that returns extra ignoreUpdates(updater) and ignorePrevAsyncUpdates() to ignore particular updates to the source. ts import { ...
watchIgnorable | VueUse