V

vueuse-functions

by @antfuv
4.5(340)

Vue.js/NuxtプロジェクトでVueUseコンポーザブル関数を適切に適用し、簡潔で保守可能な機能を構築します。

vueusevue.js-composition-apiutility-functionsfrontend-developmentGitHub
インストール方法
npx skills add antfu/skills --skill vueuse-functions
compare_arrows

Before / After 効果比較

1
使用前

Vue.js / Nuxt プロジェクトで複雑なリアクティブロジックやユーティリティ関数を手動で記述すると、コードが冗長になり、保守が困難になり、車輪の再発明を繰り返すことになります。

使用後

このスキルは、VueUse composable 関数を識別して適用し、簡潔で保守しやすいVue.js / Nuxt機能を構築することを可能にします。これにより、ボイラープレートコードが削減され、開発効率とコード品質が向上します。

SKILL.md

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

  • Apply this skill whenever assisting user development work in Vue.js / Nuxt.
  • Always check first whether a VueUse function can implement the requirement.
  • Prefer VueUse composables over custom code to improve readability, maintainability, and performance.
  • Map requirements to the most appropriate VueUse function and follow the function’s invocation rule.
  • Please refer to the Invocation field in the below functions table. For example:
    • AUTO: Use automatically when applicable.
    • EXTERNAL: Use only if the user already installed the required external dependency; otherwise reconsider, and ask to install only if truly needed.
    • EXPLICIT_ONLY: Use only when explicitly requested by the user.

    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

FunctionDescriptionInvocation
createGlobalStateKeep states in the global scope to be reusable across Vue instancesAUTO
createInjectionStateCreate global state that can be injected into componentsAUTO
createSharedComposableMake a composable function usable with multiple Vue instancesAUTO
injectLocalExtended inject with ability to call provideLocal to provide the value in the same componentAUTO
provideLocalExtended provide with ability to call injectLocal to obtain the value in the same componentAUTO
useAsyncStateReactive async stateAUTO
useDebouncedRefHistoryShorthand for useRefHistory with debounced filterAUTO
useLastChangedRecords the timestamp of the last changeAUTO
useLocalStorageReactive LocalStorageAUTO
useManualRefHistoryManually track the change history of a ref when the using calls commit()AUTO
useRefHistoryTrack the change history of a refAUTO
useSessionStorageReactive SessionStorageAUTO
useStorageCreate a reactive ref that can be used to access & modify LocalStorage or SessionStorageAUTO
useStorageAsyncReactive Storage in with async supportAUTO
useThrottledRefHistoryShorthand for useRefHistory with throttled filterAUTO

Elements

FunctionDescriptionInvocation
useActiveElementReactive document.activeElementAUTO
useDocumentVisibilityReactively track document.visibilityStateAUTO
useDraggableMake elements draggableAUTO
useDropZoneCreate a zone where files can be droppedAUTO
useElementBoundingReactive bounding box of an HTML elementAUTO
useElementSizeReactive size of an HTML elementAUTO
useElementVisibilityTracks the visibility of an element within the viewportAUTO
useIntersectionObserverDetects that a target element's visibilityAUTO
useMouseInElementReactive mouse position related to an elementAUTO
useMutationObserverWatch for changes being made to the DOM treeAUTO
useParentElementGet parent element of the given elementAUTO
useResizeObserverReports changes to the dimensions of an Element's content or the border-boxAUTO
useWindowFocusReactively track window focus with window.onfocus and window.onblur eventsAUTO
useWindowScrollReactive window scrollAUTO
useWindowSizeReactive window sizeAUTO

Browser

FunctionDescriptionInvocation
useBluetoothReactive Web Bluetooth APIAUTO
useBreakpointsReactive viewport breakpointsAUTO
useBroadcastChannelReactive BroadcastChannel APIAUTO
useBrowserLocationReactive browser locationAUTO
useClipboardReactive Clipboard APIAUTO
useClipboardItemsReactive Clipboard APIAUTO
useColorModeReactive color mode (dark / light / customs) with auto data persistenceAUTO
useCssSupportsSSR compatible and reactive CSS.supportsAUTO
useCssVarManipulate CSS variablesAUTO
useDarkReactive dark mode with auto data persistenceAUTO
useEventListenerUse EventListener with easeAUTO
useEyeDropperReactive EyeDropper APIAUTO
useFaviconReactive faviconAUTO
useFileDialogOpen file dialog with easeAUTO
useFileSystemAccessCreate and read and write local files with FileSystemAccessAPIAUTO
useFullscreenReactive Fullscreen APIAUTO
useGamepadProvides reactive bindings for the Gamepad APIAUTO
useImageReactive load an image in the browserAUTO
useMediaControlsReactive media controls for both audio and video elementsAUTO
useMediaQueryReactive Media QueryAUTO
useMemoryReactive Memory InfoAUTO
useObjectUrlReactive URL representing an objectAUTO
usePerformanceObserverObserve performance metricsAUTO
usePermissionReactive Permissions APIAUTO
usePreferredColorSchemeReactive prefers-color-scheme media queryAUTO
usePreferredContrastReactive prefers-contrast media queryAUTO
usePreferredDarkReactive dark theme preferenceAUTO
usePreferredLanguagesReactive Navigator LanguagesAUTO
usePreferredReducedMotionReactive prefers-reduced-motion media queryAUTO
usePreferredReducedTransparencyReactive prefers-reduced-transparency media queryAUTO
useScreenOrientationReactive Screen Orientation APIAUTO
useScreenSafeAreaReactive env(safe-area-inset-*)AUTO
useScriptTagCreates a script tagAUTO
useShareReactive Web Share APIAUTO
useSSRWidthUsed to set a global viewport width which will be used when rendering SSR components that rely on the viewport width like useMediaQuery or useBreakpointsAUTO
useStyleTagInject reactive style element in headAUTO
useTextareaAutosizeAutomatically update the height of a textarea depending on the contentAUTO
useTextDirectionReactive dir of the element's textAUTO
useTitleReactive document titleAUTO
useUrlSearchParamsReactive URLSearchParamsAUTO
useVibrateReactive Vibration APIAUTO
useWakeLockReactive Screen Wake Lock APIAUTO
useWebNotificationReactive NotificationAUTO
useWebWorkerSimple Web Workers registration and communicationAUTO
useWebWorkerFnRun expensive functions without blocking the UIAUTO

Sensors

FunctionDescriptionInvocation
onClickOutsideListen for clicks outside of an elementAUTO
onElementRemovalFires when the element or any element containing it is removed from the DOMAUTO
onKeyStrokeListen for keyboard keystrokesAUTO
onLongPressListen for a long press on an elementAUTO
onStartTypingFires when users start typing on non-editable elementsAUTO
useBatteryReactive Battery Status APIAUTO
useDeviceMotionReactive DeviceMotionEventAUTO
useDeviceOrientationReactive DeviceOrientationEventAUTO
useDevicePixelRatioReactively track window.devicePixelRatioAUTO
useDevicesListReactive enumerateDevices listing available input/output devicesAUTO
useDisplayMediaReactive mediaDevices.getDisplayMedia streamingAUTO
useElementByPointReactive element by pointAUTO
useElementHoverReactive element's hover stateAUTO
useFocusReactive utility to track or set the focus state of a DOM elementAUTO
useFocusWithinReactive utility to track if an element or one of its decendants has focusAUTO
useFpsReactive FPS (frames per second)AUTO
useGeolocationReactive Geolocation APIAUTO
useIdleTracks whether the user is being inactiveAUTO
useInfiniteScrollInfinite scrolling of the elementAUTO
useKeyModifierReactive Modifier StateAUTO
useMagicKeysReactive keys pressed stateAUTO
useMouseReactive mouse positio

...

ユーザーレビュー (0)

レビューを書く

効果
使いやすさ
ドキュメント
互換性

レビューなし

統計データ

インストール数15.3K
評価4.5 / 5.0
バージョン
更新日2026年5月23日
比較事例1 件

ユーザー評価

4.5(340)
5
23%
4
51%
3
23%
2
2%
1
0%

この Skill を評価

0.0

対応プラットフォーム

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

タイムライン

作成2026年3月16日
最終更新2026年5月23日