Vueuse functions

From YuDefine/nuxt-supabase-starter · View interactive version

Vueuse functions is an AI agent skill from the GitHub repository YuDefine/nuxt-supabase-starter. Apply VueUse composables where appropriate to build concise, maintainable Vue.js / Nuxt features.

How to use this skill

Skill file

VueUse Functions

This skill is a decision-and-implementation guide for VueUse composables in Vue.js / Nuxt projects. It maps requirements to the most suitable VueUse function, applies the correct usage pattern, and prefers composable-based solutions over bespoke code to keep implementations concise, maintainable, and performant.

When to Apply

> NOTE User instructions in the prompt or AGENTS.md may override a function’s default Invocation rule.

Functions

All functions listed below are part of the VueUse library, each section categorizes functions based on their functionality.

IMPORTANT: Each function entry includes a short Description and a detailed Reference. When using any function, always consult the corresponding document in ./references for Usage details and Type Declarations.

State

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Keep states in the global scope to be reusable across Vue instances | AUTO |

| CODE0 | Create global state that can be injected into components | AUTO |

| CODE0 | Make a composable function usable with multiple Vue instances | AUTO |

| CODE0 | Extended inject with ability to call provideLocal to provide the value in the same component | AUTO |

| CODE0 | Extended provide with ability to call injectLocal to obtain the value in the same component | AUTO |

| CODE0 | Reactive async state | AUTO |

| CODE0 | Shorthand for useRefHistory with debounced filter | AUTO |

| CODE0 | Records the timestamp of the last change | AUTO |

| CODE0 | Reactive LocalStorage | AUTO |

| CODE0 | Manually track the change history of a ref when the user calls commit() | AUTO |

| CODE0 | Track the change history of a ref | AUTO |

| CODE0 | Reactive SessionStorage | AUTO |

| CODE0 | Create a reactive ref that can be used to access & modify LocalStorage or SessionStorage | AUTO |

| CODE0 | Reactive Storage with async support | AUTO |

| CODE0 | Shorthand for useRefHistory with throttled filter | AUTO |

Elements

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Reactive document.activeElement | AUTO |

| CODE0 | Reactively track CODE1 | AUTO |

| CODE0 | Make elements draggable | AUTO |

| CODE0 | Create a zone where files can be dropped | AUTO |

| CODE0 | Reactive bounding box of an HTML element | AUTO |

| CODE0 | Reactive element's overflow state | AUTO |

| CODE0 | Reactive size of an HTML element | AUTO |

| CODE0 | Tracks the visibility of an element within the viewport | AUTO |

| CODE0 | Detects changes to a target element's visibility | AUTO |

| CODE0 | Reactive mouse position related to an element | AUTO |

| CODE0 | Watch for changes being made to the DOM tree | AUTO |

| CODE0 | Get parent element of the given element | AUTO |

| CODE0 | Reports changes to the dimensions of an Element's content or the border-box | AUTO |

| CODE0 | Reactively track window focus with window.onfocus and window.onblur events | AUTO |

| CODE0 | Reactive window scroll | AUTO |

| CODE0 | Reactive window size | AUTO |

Browser

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Reactive Web Bluetooth API | AUTO |

| CODE0 | Reactive viewport breakpoints | AUTO |

| CODE0 | Reactive BroadcastChannel API | AUTO |

| CODE0 | Reactive browser location | AUTO |

| CODE0 | Reactive Clipboard API | AUTO |

| CODE0 | Reactive Clipboard API | AUTO |

| CODE0 | Reactive color mode (dark / light / customs) with auto data persistence | AUTO |

| CODE0 | SSR compatible and reactive CODE1 | AUTO |

| CODE0 | Manipulate CSS variables | AUTO |

| CODE0 | Reactive dark mode with auto data persistence | AUTO |

| CODE0 | Use EventListener with ease | AUTO |

| CODE0 | Reactive EyeDropper API | AUTO |

| CODE0 | Reactive favicon | AUTO |

| CODE0 | Open file dialog with ease | AUTO |

| CODE0 | Create and read and write local files with FileSystemAccessAPI | AUTO |

| CODE0 | Reactive Fullscreen API | AUTO |

| CODE0 | Provides reactive bindings for the Gamepad API | AUTO |

| CODE0 | Reactive load an image in the browser | AUTO |

| CODE0 | Accessible way to announce messages to screen reader users (ARIA live regions) | AUTO |

| CODE0 | Reactive media controls for both audio and video elements | AUTO |

| CODE0 | Reactive Media Query | AUTO |

| CODE0 | Reactive Memory Info | AUTO |

| CODE0 | Reactive URL representing an object | AUTO |

| CODE0 | Observe performance metrics | AUTO |

| CODE0 | Reactive Permissions API | AUTO |

| CODE0 | Reactive prefers-color-scheme media query | AUTO |

| CODE0 | Reactive prefers-contrast media query | AUTO |

| CODE0 | Reactive dark theme preference | AUTO |

| CODE0 | Reactive Navigator Languages | AUTO |

| CODE0 | Reactive prefers-reduced-motion media query | AUTO |

| CODE0 | Reactive prefers-reduced-transparency media query | AUTO |

| CODE0 | Reactive Screen Orientation API | AUTO |

| CODE0 | Reactive env(safe-area-inset-*) | AUTO |

| CODE0 | Creates a script tag | AUTO |

| CODE0 | Reactive Web Share API | AUTO |

| CODE0 | Used to set a global viewport width which will be used when rendering SSR components that rely on the viewport width like CODE1 or CODE2 | AUTO |

| CODE0 | Inject reactive style element in head | AUTO |

| CODE0 | Automatically update the height of a textarea depending on the content | AUTO |

| CODE0 | Reactive dir of the element's text | AUTO |

| CODE0 | Reactive document title | AUTO |

| CODE0 | Reactive URLSearchParams | AUTO |

| CODE0 | Reactive Vibration API | AUTO |

| CODE0 | Reactive Screen Wake Lock API | AUTO |

| CODE0 | Register a WebMCP tool and tie its lifecycle to the current Vue scope | AUTO |

| CODE0 | Reactive Notification | AUTO |

| CODE0 | Simple Web Workers registration and communication | AUTO |

| CODE0 | Run expensive functions without blocking the UI | AUTO |

Sensors

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Listen for clicks outside of an element | AUTO |

| CODE0 | Fires when the element or any element containing it is removed from the DOM | AUTO |

| CODE0 | Listen for keyboard keystrokes | AUTO |

| CODE0 | Listen for a long press on an element | AUTO |

| CODE0 | Fires when users start typing on non-editable elements | AUTO |

| CODE0 | Reactive Battery Status API | AUTO |

| CODE0 | Reactive DeviceMotionEvent | AUTO |

| CODE0 | Reactive DeviceOrientationEvent | AUTO |

| CODE0 | Reactively track CODE1 | AUTO |

| CODE0 | Reactive enumerateDevices listing available input/output devices | AUTO |

| CODE0 | Reactive CODE1 streaming | AUTO |

| CODE0 | Reactive element by point | AUTO |

| CODE0 | Reactive element's hover state | AUTO |

| CODE0 | Reactive utility to track or set the focus state of a DOM element | AUTO |

| CODE0 | Reactive utility to track if an element or one of its descendants has focus | AUTO |

| CODE0 | Reactive FPS (frames per second) | AUTO |

| CODE0 | Reactive Geolocation API | AUTO |

| CODE0 | Tracks whether the user is being inactive | AUTO |

| CODE0 | Infinite scrolling of the element | AUTO |

| CODE0 | Reactive Modifier State | AUTO |

| CODE0 | Reactive keys pressed state | AUTO |

| CODE0 | Reactive mouse position | AUTO |

| CODE0 | Reactive mouse pressing state | AUTO |

| CODE0 | Reactive navigator.language | AUTO |

| CODE0 | Reactive Network status | AUTO |

| CODE0 | Reactive online state | AUTO |

| CODE0 | Reactive state to show whether the mouse leaves the page | AUTO |

| CODE0 | Create parallax effect easily | AUTO |

| CODE0 | Reactive pointer state | AUTO |

| CODE0 | Reactive pointer lock | AUTO |

| CODE0 | Reactive swipe detection based on PointerEvents | AUTO |

| CODE0 | Reactive scroll position and state | AUTO |

| CODE0 | Lock scrolling of the element | AUTO |

| CODE0 | Reactive SpeechRecognition | AUTO |

| CODE0 | Reactive SpeechSynthesis | AUTO |

| CODE0 | Reactive swipe detection based on CODE1 | AUTO |

| CODE0 | Reactively track user text selection based on CODE1 | AUTO |

| CODE0 | Reactive CODE1 streaming | AUTO |

Network

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | An EventSource or Server-Sent-Events instance opens a persistent connection to an HTTP server | AUTO |

| CODE0 | Reactive Fetch API provides the ability to abort requests | AUTO |

| CODE0 | Reactive WebSocket client | AUTO |

Animation

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Reactive Web Animations API | AUTO |

| CODE0 | Reactive counter that increases on every interval | AUTO |

| CODE0 | Wrapper for setInterval with controls | AUTO |

| CODE0 | Reactive current Date instance | AUTO |

| CODE0 | Call function on every requestAnimationFrame | AUTO |

| CODE0 | Reactive value that becomes true after a given time | AUTO |

| CODE0 | Wrapper for setTimeout with controls | AUTO |

| CODE0 | Reactive current timestamp | AUTO |

| CODE0 | Transition between values | AUTO |

Component

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Combine computed and inject | AUTO |

| CODE0 | Define and reuse template inside the component scope | AUTO |

| CODE0 | Template as Promise | AUTO |

| CODE0 | Safe onBeforeMount | AUTO |

| CODE0 | Safe onBeforeUnmount | AUTO |

| CODE0 | Safe onMounted | AUTO |

| CODE0 | Safe onScopeDispose | AUTO |

| CODE0 | Safe onUnmounted | AUTO |

| CODE0 | Retrieves the underlying DOM element from a Vue ref or component instance | AUTO |

| CODE0 | Get the DOM element of current component as a ref | AUTO |

| CODE0 | Mounted state in ref | AUTO |

| CODE0 | Shorthand for binding refs to template elements and components inside v-for | AUTO |

| CODE0 | Create virtual lists with ease | AUTO |

| CODE0 | Shorthand for v-model binding | AUTO |

| CODE0 | Shorthand for props v-model binding | AUTO |

Watch

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Promised one-time watch for changes | AUTO |

| CODE0 | Watch for an array with additions and removals | AUTO |

| CODE0 | watch with the number of times triggered | AUTO |

| CODE0 | Debounced watch | AUTO |

| CODE0 | Shorthand for watching value with {deep: true} | AUTO |

| CODE0 | Ignorable watch | AUTO |

| CODE0 | Shorthand for watching value with {immediate: true} | AUTO |

| CODE0 | Shorthand for watching value with { once: true } | AUTO |

| CODE0 | Pausable watch | AUTO |

| CODE0 | Throttled watch | AUTO |

| CODE0 | Watch that can be triggered manually | AUTO |

| CODE0 | watch with additional EventFilter control | AUTO |

| CODE0 | Shorthand for watching value to be truthy | AUTO |

Reactivity

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Computed for async functions | AUTO |

| CODE0 | Eager computed without lazy evaluation | AUTO |

| CODE0 | Explicitly define the dependencies of computed | AUTO |

| CODE0 | Returns a deepRef or shallowRef depending on the deep param | AUTO |

| CODE0 | Add extra attributes to Ref | AUTO |

| CODE0 | Converts plain functions into reactive functions | AUTO |

| CODE0 | Apply reactify to an object | AUTO |

| CODE0 | Computed reactive object | AUTO |

| CODE0 | Reactively omit fields from a reactive object | AUTO |

| CODE0 | Reactively pick fields from a reactive object | AUTO |

| CODE0 | A ref which will be reset to the default value after some time | AUTO |

| CODE0 | Debounce execution of a ref value | AUTO |

| CODE0 | Apply default value to a ref | AUTO |

| CODE0 | Create a ref with manual reset functionality | AUTO |

| CODE0 | Throttle changing of a ref value | AUTO |

| CODE0 | Fine-grained controls over ref and its reactivity | AUTO |

| CODE0 | Two-way refs synchronization | AUTO |

| CODE0 | Keep target refs in sync with a source ref | AUTO |

| CODE0 | Converts ref to reactive | AUTO |

| CODE0 | Normalize value/ref/getter to ref or computed | EXPLICIT_ONLY |

| CODE0 | Extended CODE1 that also accepts refs of an object | AUTO |

Array

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Reactive get array difference of two arrays | AUTO |

| CODE0 | Reactive Array.every | AUTO |

| CODE0 | Reactive Array.filter | AUTO |

| CODE0 | Reactive Array.find | AUTO |

| CODE0 | Reactive Array.findIndex | AUTO |

| CODE0 | Reactive Array.findLast | AUTO |

| CODE0 | Reactive Array.includes | AUTO |

| CODE0 | Reactive Array.join | AUTO |

| CODE0 | Reactive Array.map | AUTO |

| CODE0 | Reactive Array.reduce | AUTO |

| CODE0 | Reactive Array.some | AUTO |

| CODE0 | Reactive unique array | AUTO |

| CODE0 | Reactive sort array | AUTO |

Time

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Reactive countdown timer in seconds | AUTO |

| CODE0 | Get the formatted date according to the string of tokens passed in | AUTO |

| CODE0 | Reactive Temporal API with timezone conversion and calendar system support | AUTO |

| CODE0 | Reactive time ago | AUTO |

| CODE0 | Reactive time ago with i18n supported | AUTO |

Utilities

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Utility for authoring disposable directives | AUTO |

| CODE0 | Utility for creating event hooks | AUTO |

| CODE0 | Make a plain function accepting ref and raw values as arguments | AUTO |

| CODE0 | Shorthand for accessing ref.value | EXPLICIT_ONLY |

| CODE0 | Non-nullish checking type guard for Ref | AUTO |

| CODE0 | Make isomorphic destructurable for object and array at the same time | AUTO |

| CODE0 | Shorthand for ref.value = x | EXPLICIT_ONLY |

| CODE0 | Executes each asynchronous task sequentially and passes the current task result to the next task | AUTO |

| CODE0 | Reactive base64 transforming | AUTO |

| CODE0 | Cache a ref with a custom comparator | AUTO |

| CODE0 | Reactive clone of a ref | AUTO |

| CODE0 | Creates event hooks to support modals and confirmation dialog chains | AUTO |

| CODE0 | Basic counter with utility functions | AUTO |

| CODE0 | Cycle through a list of items | AUTO |

| CODE0 | Debounce execution of a function | AUTO |

| CODE0 | A basic event bus | AUTO |

| CODE0 | Cache results of functions depending on arguments and keep it reactive | AUTO |

| CODE0 | Reactive offset pagination | AUTO |

| CODE0 | Holds the previous value of a ref | AUTO |

| CODE0 | Provides helpers for building a multi-step wizard interface | AUTO |

| CODE0 | SSR compatibility isSupported | AUTO |

| CODE0 | Throttle execution of a function | AUTO |

| CODE0 | Use timeout to poll something | AUTO |

| CODE0 | A boolean switcher with utility functions | AUTO |

| CODE0 | Reactively convert a string ref to number | AUTO |

| CODE0 | Reactively convert a ref to string | AUTO |

@Electron

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Provides ipcRenderer and all of its APIs with Vue reactivity | EXTERNAL |

| CODE0 | Reactive ipcRenderer.invoke API result | EXTERNAL |

| CODE0 | Use ipcRenderer.on with ease and ipcRenderer.removeListener automatically on unmounted | EXTERNAL |

| CODE0 | Reactive WebFrame zoom factor | EXTERNAL |

| CODE0 | Reactive WebFrame zoom level | EXTERNAL |

@Firebase

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Reactive Firebase Auth binding | EXTERNAL |

| CODE0 | Reactive Firestore binding | EXTERNAL |

| CODE0 | Reactive Firebase Realtime Database binding | EXTERNAL |

@Head

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Create the head manager instance. | EXTERNAL |

| CODE0 | Update head meta tags reactively. | EXTERNAL |

@Integrations

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Wrapper for CODE1 | EXTERNAL |

| CODE0 | Wrapper for CODE1 | EXTERNAL |

| CODE0 | Reactive wrapper for CODE1 | EXTERNAL |

| CODE0 | Wrapper for CODE1 | EXTERNAL |

| CODE0 | Reactive instance for drauu | EXTERNAL |

| CODE0 | Reactive wrapper for CODE1 | EXTERNAL |

| CODE0 | Easily implement fuzzy search using a composable with Fuse.js | EXTERNAL |

| CODE0 | Wrapper for CODE1 | EXTERNAL |

| CODE0 | Wrapper for CODE1 | EXTERNAL |

| CODE0 | Reactive wrapper for CODE1 | EXTERNAL |

| CODE0 | Wrapper for CODE1 | EXTERNAL |

| CODE0 | Wrapper for CODE1 | EXTERNAL |

@Math

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Generic version of createProjection | EXTERNAL |

| CODE0 | Reactive numeric projection from one domain to another | EXTERNAL |

| CODE0 | AND condition for refs | EXTERNAL |

| CODE0 | NOT condition for ref | EXTERNAL |

| CODE0 | OR conditions for refs | EXTERNAL |

| CODE0 | Reactive Math.abs | EXTERNAL |

| CODE0 | Get the average of an array reactively | EXTERNAL |

| CODE0 | Reactive Math.ceil | EXTERNAL |

| CODE0 | Reactively clamp a value between two other values | EXTERNAL |

| CODE0 | Reactive Math.floor | EXTERNAL |

| CODE0 | Reactive Math methods | EXTERNAL |

| CODE0 | Reactive Math.max | EXTERNAL |

| CODE0 | Reactive Math.min | EXTERNAL |

| CODE0 | Reactively set the precision of a number | EXTERNAL |

| CODE0 | Reactive numeric projection from one domain to another | EXTERNAL |

| CODE0 | Reactive Math.round | EXTERNAL |

| CODE0 | Get the sum of an array reactively | EXTERNAL |

| CODE0 | Reactive Math.trunc | EXTERNAL |

@Motion

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Sync a reactive object to a target element CSS styling | EXTERNAL |

| CODE0 | Sync a reactive object to a target element CSS transform. | EXTERNAL |

| CODE0 | Putting your components in motion. | EXTERNAL |

| CODE0 | Access Motion Properties for a target element. | EXTERNAL |

| CODE0 | Handle the Variants state and selection. | EXTERNAL |

| CODE0 | Spring animations. | EXTERNAL |

@Router

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Shorthand for a reactive route.hash | EXTERNAL |

| CODE0 | Shorthand for a reactive route.params | EXTERNAL |

| CODE0 | Shorthand for a reactive route.query | EXTERNAL |

@RxJS

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Wrappers around RxJS's CODE1 and CODE2 to allow them to accept refs | EXTERNAL |

| CODE0 | Sugar function to convert a ref into an RxJS Observer | EXTERNAL |

| CODE0 | Use an RxJS CODE1 as extracted from one or more composables | EXTERNAL |

| CODE0 | Use an RxJS CODE1 | EXTERNAL |

| CODE0 | Bind an RxJS CODE1 to a ref and propagate value changes both ways | EXTERNAL |

| CODE0 | Use an RxJS CODE1 without worrying about unsubscribing from it or creating memory leaks | EXTERNAL |

| CODE0 | Watch the values of an RxJS CODE1 as extracted from one or more composables | EXTERNAL |

@SchemaOrg

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Create the schema.org manager instance. | EXTERNAL |

| CODE0 | Update schema.org reactively. | EXTERNAL |

@Sound

| Function | Description | Invocation |

|----------|-------------|------------|

| CODE0 | Play sound effects reactively. | EXTERNAL |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.