Back to Vue.js

Motion (Vue)

vuenuxtanimationmotion-vui-uxfrontenddeclarative-animationsjavascript
682🕒 2026-06-01Source ↗

Install this skill

npx skills add onmax/nuxt-skills

Works across Claude Code, Cursor, Codex, Copilot & Antigravity

Motion Vue (motion-v) provides a Vue 3 implementation of the motion library, bringing declarative animation logic to components. It handles visual state changes through a controlled API that maps standard HTML elements to animatable counterparts. The library focuses on performance by utilizing hardware acceleration for layout transformations and spring-based physics. Developers define visual states for mounting, unmounting, and hover or tap interactions directly within the template or script sections. It replaces manual CSS transition management with a script-based approach that syncs element properties with motion values. This package is optimized for Nuxt 3 environments, allowing for simplified integration through module configuration. It provides predictable interpolation and gesture tracking while maintaining a small footprint, ensuring that complex UI interactions do not degrade core performance metrics during user navigation.

When to Use This Skill

  • Adding entrance transitions to list items or cards
  • Creating interactive buttons with scale or rotation feedback
  • Triggering reveal animations as elements enter the viewport
  • Synchronizing element positions across state changes
  • Applying complex spring physics to UI components

How to Invoke This Skill

Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:

  • How do I add a spring animation to my Vue component?
  • Animate elements when they scroll into view
  • Add hover and click effects to a button in Nuxt
  • How to manage enter and leave transitions with Motion Vue
  • Bind motion values to scroll position in Vue 3

Pro Tips

  • 💡When requesting complex sequences, break them down into smaller, composable Motion Vue animations and let the agent orchestrate their timing, rather than trying to describe one monolithic animation.
  • 💡Specify performance considerations explicitly (e.g., 'prioritize hardware-accelerated transforms') when generating animations to ensure the agent outputs highly optimized code.
  • 💡For shared layout transitions, guide the agent to correctly identify the `layoutId` props for matching elements across different states, ensuring seamless visual continuity.

What this skill does

  • Declarative animation states for mount, unmount, and hover
  • Spring-based physics for natural motion transitions
  • Hardware-accelerated layout and shared element movement
  • Gesture-responsive props for interaction feedback
  • Viewport-aware animations triggered by scroll position

When not to use it

  • Projects requiring complex SVG path morphing or timeline sequences
  • High-performance tasks better suited for direct GPU-accelerated canvas API
  • Simple state-driven changes that only require native CSS keyframes

Example workflow

  1. Install the motion-v package and register the Nuxt module
  2. Import the Motion component into your Vue file
  3. Define initial, animate, and exit prop objects on the element
  4. Apply gesture props like whileHover for immediate interaction feedback
  5. Configure custom spring or duration values within the transition prop

Prerequisites

  • Vue 3
  • Nuxt 3 (recommended for module integration)

Pitfalls & limitations

  • !Over-animating elements can lead to UI clutter and accessibility issues
  • !Mixing local motion-v animations with global CSS transitions may cause visual conflicts
  • !Large-scale layout animations on complex DOM trees may require performance tuning

FAQ

Is motion-v the same as @vueuse/motion?
No, motion-v is a specific port of the Motion library. While similar in purpose, they provide different APIs and feature sets.
Can I use this for complex animation sequences?
Motion-v is built for declarative component states. If your project requires frame-perfect timeline control, consider using GSAP.
Does this work with server-side rendering?
Yes, it is designed for Nuxt 3, though complex layout animations are primarily evaluated on the client-side after hydration.

How it compares

Motion-v replaces verbose CSS class toggling and manual event listeners with a declarative syntax, providing tighter synchronization between element state and physical motion properties.

Source & trust

682 stars🕒 Updated 2026-06-01
📄 Full skill instructions — original source: onmax/nuxt-skills
# Motion Vue (motion-v)

Animation library for Vue 3 and Nuxt. Production-ready, hardware-accelerated animations with minimal bundle size.

**Current stable:** motion-v 1.x - Vue port of Motion (formerly Framer Motion)

## Overview

Progressive reference for Motion Vue animations. Load only files relevant to current task (~200 tokens base, 500-1500 per sub-file).

## When to Use

**Use Motion Vue for:**

- Simple declarative animations (fade, slide, scale)
- Gesture-based interactions (hover, tap, drag)
- Scroll-linked animations
- Layout animations and shared element transitions
- Spring physics animations

**Consider alternatives:**

- **GSAP** - Complex timelines, SVG morphing, scroll-triggered sequences
- **@vueuse/motion** - Simpler API, less features, smaller bundle
- **CSS animations** - Simple transitions without JS

## Installation

# Vue 3
pnpm add motion-v

# Nuxt 3
pnpm add motion-v @vueuse/nuxt


// nuxt.config.ts - Nuxt 3 setup
export default defineNuxtConfig({
modules: ['motion-v/nuxt'],
})


## Quick Reference

| Working on... | Load file |
| ---------------------------- | ------------------------- |
| Motion component, gestures | references/components.md |
| useMotionValue, useScroll | references/composables.md |
| Animation examples, patterns | references/examples.md |

## Loading Files

**Load one file at a time based on context:**

- Component animations → [references/components.md](references/components.md)
- Composables, motion values → [references/composables.md](references/composables.md)
- Examples, inspiration → [references/examples.md](references/examples.md)

## Core Concepts

### Motion Component

Render any HTML/SVG element with animation capabilities:

<script setup lang="ts">
import { Motion } from 'motion-v'
</script>

<template>
<Motion.div
:initial="{ opacity: 0, y: 20 }"
:animate="{ opacity: 1, y: 0 }"
:exit="{ opacity: 0, y: -20 }"
:transition="{ duration: 0.3 }"
>
Animated content
</Motion.div>
</template>


### Gesture Animations

<Motion.button
:whileHover="{ scale: 1.05 }"
:whilePress="{ scale: 0.95 }"
:transition="{ type: 'spring', stiffness: 400 }"
>
Click me
</Motion.button>


### Scroll Animations

<Motion.div
:initial="{ opacity: 0 }"
:whileInView="{ opacity: 1 }"
:viewport="{ once: true, margin: '-100px' }"
>
Appears on scroll
</Motion.div>


## Available Guidance

**[references/components.md](references/components.md)** - Motion component variants, animation props, gesture props, layout animations, transition configuration

**[references/composables.md](references/composables.md)** - useMotionValue, useSpring, useTransform, useScroll, useInView, animate()

**[references/examples.md](references/examples.md)** - External resources, component libraries, animation patterns and inspiration

How to Use This Skill Unit

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/motion/
  3. Save the file as SKILL.md
  4. The agent will automatically discover the skill based on its description.

Option B: Global Installation (All Agents)

Save the file to these locations to make it available across all projects:

  • Claude Code: ~/.claude/skills/onmax/nuxt-skills/motion/SKILL.md
  • Cursor: ~/.cursor/skills/onmax/nuxt-skills/motion/SKILL.md
  • Antigravity: ~/.gemini/antigravity/skills/onmax/nuxt-skills/motion/SKILL.md

🚀 Install with CLI:
npx skills add onmax/nuxt-skills

Read the Master Guide: Mastering Agent Skills

Recommended Rules

View more rules

Recommended Workflows

View more workflows

Recommended MCP Servers

View more MCP servers

Take It Further

Maximize your productivity with these powerful resources

📋

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
📖

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid vue.js issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under Vue.js and is published by Onmax, maintained in onmax/nuxt-skills.

← Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.