vueuse-motion-skilld
БесплатноБез исполняемых скриптовНе проверенUse when writing, reviewing, or debugging code that imports @vueuse/motion (v-motion directive, Motion/MotionGroup components, useMotion, useSpring, presets…
от skilld-dev★ 188 звёзд на GitHubОб этом скилле
@vueuse/motion 3.0.3
Vue 3 composables for declarative animation, built on Popmotion (not WAAPI). Three interchangeable surfaces: v-motion directive, <Motion>/<MotionGroup> components, and the useMotion() composable.
Environment limits
- Vue 3 only (
vue >=3.0.0peer,package.json:79-81). - ESM-only since v3.0.0: no CommonJS build (
"type": "module", only.mjsexports,package.json:2,31-35; https://github.com/vueuse/motion/pull/254). Norequire(); CJS projects must migrate to ESM or dynamicimport(). - Depends on
@vueuse/core/@vueuse/sharedv13,popmotion11 (package.json:82-89). - Nuxt integration needs
@nuxt/kit>=3.13 (optional dependency,package.json:90-92). - Animations run on
window; SSR only renders theinitialvariant as inline styles (see Nuxt & SSR).
Setup
Vue app entry (README.md:32-44):
import { createApp } from 'vue'
import { MotionPlugin } from '@vueuse/motion'
import App from './App.vue'
createApp(App).use(MotionPlugin).mount('#app')
MotionPlugin registers the v-motion directive, 30 preset directives (v-motion-fade, ...), global Motion/MotionGroup components, and custom directives from options (dist/index.mjs:1712-1736).
app.use(MotionPlugin, {
directives: { 'pop-bottom': { initial: { scale: 0, y: 100 }, visible: { scale: 1, y: 0 } } },
excludePresets: true, // skip the 30 built-in preset directives
})
Nuxt: add '@vueuse/motion/nuxt' to modules; the plugin, components, and composable auto-imports are installed for you (dist/nuxt/module.mjs:13-24). See Nuxt & SSR.
Common tasks
Directive (most common)
<template>
<div
v-motion
:initial="{ opacity: 0, y: 100 }"
:enter="{ opacity: 1, y: 0 }"
/>
<!-- Preset: applies the built-in slideVisibleLeft variants -->
<div v-motion-slide-visible-left />
</template>
Variant props: initial, enter, leave, visible, visibleOnce (kebab visible-once also accepted, dist/index.mjs:1054-1057), hovered, tapped, focused, plus :variants for custom keys. Shorthand :delay / :duration (milliseconds) apply to the enter/visible/visibleOnce transitions (dist/index.mjs:1043-1051).
Component (better SSR/MDC compatibility)
<Motion is="p" preset="slideVisibleLeft" :duration="600">Text in Motion!</Motion>
preset takes the camelCase preset name, including names from plugin directives (dist/index.mjs:1551-1562). <MotionGroup> applies one config to all children, renderless unless given :is.
Composable (programmatic control)
<script setup lang="ts">
import { ref } from 'vue'
import { useMotion } from '@vueuse/motion'
const target = ref<HTMLElement>()
const { variant, apply, stop } = useMotion(target, {
initial: { opacity: 0, y: 100 },
enter: { opacity: 1, y: 0 },
custom2: { scale: 1.2 },
})
// switch variant (triggers transition): variant.value = 'custom2'
// temporary animation, then revert: await apply({ scale: 2 }); await apply('enter')
</script>
Instance members: target, variant, variants, state, motionProperties, apply, set, stop, leave, isAnimating (dist/index.d.mts:535-576). Full surface: API reference.
Access a template motion from script
Give the directive a string value, then read it from useMotions():
<div v-motion="'hero'" :initial="{ opacity: 0 }" :enter="{ opacity: 1 }" />
const motions = useMotions()
const play = () => { motions.hero?.variant.value = 'custom' }
Rules that prevent bugs
- Durations, delays, and
repeatDelayare milliseconds (delay: 1000= 1s). The JSDoc indist/index.d.mtssays "in seconds" (copied from Framer Motion types) but values pass straight to Popmotion in ms; official docs and runtime defaults (300/800) are ms (dist/index.mjs:266-281,431-441; https://motion.vueuse.org/features/transition-properties.html). - Always declare
initialwith every key you animate later, so elements start from a known state andleave/visiblereversal has a base to return to (https://motion.vueuse.org/features/variants.html). visiblere-appliesinitialwhen the element leaves the viewport;visibleOncefires once (dist/index.mjs:696-707).- Do not destructure
useMotions()at setup top level. Instances register after setup runs; keep the object and index it lazily (motions.hero?.apply('x')). Registration is global and keyed by the string value passed tov-motion(dist/index.mjs:9,1065; https://github.com/vueuse/motion/issues/109). apply('unknown-key')throwsThe variant unknown-key does not exist.Use object formapply({ ... })for one-off states (dist/index.mjs:534-537).leave(done)expects aleavevariant, falling back toinitial; map it onto<transition @leave="(el, done) => leave(done)">(dist/index.mjs:568-582).- **Default transitions
Установить vueuse-motion-skilld в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл vueuse-motion-skilld?
Use when writing, reviewing, or debugging code that imports @vueuse/motion (v-motion directive, Motion/MotionGroup components, useMotion, useSpring, presets, Nuxt module). Gives correct v3.x API usage, variants and transition syntax, SSR behavior, and setup for Vue 3 and Nuxt 3.
Как установить скилл vueuse-motion-skilld?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл vueuse-motion-skilld запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic