motion-v-skilld
npx skills add https://github.com/harlan-zw/vue-ecosystem-skills --skill motion-v-skilld
Agent 安装分布
Skill 文档
motiondivision/motion-vue motion-v
Version: 2.0.0-beta.4 (Feb 2026) Deps: framer-motion@^12.29.2, hey-listen@^1.0.8, motion-dom@^12.29.2, motion-utils@^12.29.2 Tags: latest: 2.0.0-beta.4 (Feb 2026)
References: Docs â API reference, guides ⢠GitHub Issues â bugs, workarounds, edge cases ⢠GitHub Discussions â Q&A, patterns, recipes ⢠Releases â changelog, breaking changes, new APIs
API Changes
This section documents version-specific API changes â prioritize recent major/minor releases.
-
BREAKING:
focus,hover,press,inViewshorthand props â removed in v2.0.0-beta.1. UsewhileFocus,whileHover,whilePress, andwhileInViewfor animations, and full event handlers (e.g.@hoverStart,@pressStart) for logic source -
NEW:
v-motiondirective â new in v2.0.0-beta.1, enables declarative animations on any element without requiring a<motion>component wrapper source -
BREAKING: ESM-only â v2.0.0-beta.1 dropped CommonJS support. The package now only ships ESM (
.mjs) exports source -
NEW:
MotionPluginâ new in v2.0.0-beta.1, a Vue plugin for globalv-motionand custom preset directive registration -
NEW:
createPresetDirective()â new in v2.0.0-beta.1, allows creating reusable animation directives with baked-in motion options -
BREAKING:
AnimatePresencelazy discovery â v2.0.0-beta.1 refactored to usedata-apattribute for lazy discovery instead of eager registration source -
DEPRECATED:
staggerChildrenandstaggerDirectionâ deprecated in v1.4.0 in favor of using thestagger()utility within thetransitionprop source -
NEW:
stagger()utility â correctly handles staggering for newly-entering siblings alongside existing ones since v1.7.0 source -
NEW:
useTransformoutput maps â supports providing multiple output value maps for complex coordinate transformations since v1.9.0 source -
NEW:
Reorderauto-scrolling â supports automatic parent container scrolling when aReorder.Itemis dragged to the edges since v1.8.0 source -
NEW:
useScrollVueInstance support âcontainerandtargetoptions now acceptVueInstance(ref to component) since v1.6.0 source -
NEW:
useInViewrootoption â now acceptsMaybeReffor dynamic root element assignment since v1.6.0 source -
NEW:
AnimatePresencedirect children â supports multiple directmotioncomponents as children since v1.10.0 source -
NEW:
delayInMsâ exported as a standalone utility function for time-based animation delays since v1.6.0 source
Also changed: useTransform reactive update fix (v1.2.1) · sequence at relative start (v1.3.0) · AnimatePresence custom prop fix (v1.3.0) · motionGlobalConfig exported (v2.0.0-beta.1) · FeatureBundle tree-shaking architecture (v2.0.0-beta.1)
Best Practices
- Create motion-supercharged components using
motion.create()outside of the template to avoid re-creating the component on every render, which would break animations source
// Preferred
const MotionComponent = motion.create(Component)
// Avoid - re-created every render
<component :is="motion.create(Component)" />
- Use
MotionValues in thestyleprop to animate values outside of the Vue render cycle, significantly improving performance by avoiding frequent re-renders source
<script setup>
const x = useMotionValue(0)
</script>
<template>
<motion.div :style="{ x }" />
</template>
- Reduce initial bundle size from ~34kb to ~6kb by using the
mcomponent paired withLazyMotionto load features synchronously or asynchronously only when needed source
<template>
<LazyMotion :features="domAnimation">
<m.div :animate="{ opacity: 1 }" />
</LazyMotion>
</template>
-
Enable the
strictprop onLazyMotionduring development to catch accidental usage of the fullmotioncomponent, which would negate the bundle size benefits of lazy loading source -
Centralize animation settings like global transitions and site-wide
reducedMotionpolicies usingMotionConfigto ensure consistent behavior across all child components source -
(experimental) Apply declarative animations directly to any standard HTML/SVG element using the
v-motiondirective in v2.0.0-beta.1+ without needing to wrap elements in a<motion>component source -
Ensure
AnimatePresencechildren have unique, stablekeyprops and are direct children of the component to correctly track their removal for exit animations source -
Synchronize layout animations across unrelated components (those that don’t share a parent-child relationship but affect each other’s layout) by wrapping them in a
LayoutGroupsource -
Prevent visual distortion of child elements during parent layout animations by applying the
layoutprop to the immediate children as well, enabling scale correction source -
Mark scrollable ancestors with
layoutScrolland fixed-position ancestors withlayoutRootto ensure Motion correctly accounts for scroll offsets during layout measurements source