motion
БесплатноБез исполняемых скриптовНе проверенImplement smooth, accessible animations with motion/react (Framer Motion) in React. Use when adding animations, gestures, or layout transitions with motion…
от Asymmetric-al★ 354 звезды на GitHubОб этом скилле
Motion (motion/react) in Core
API usage for motion/react. Core's motion contract (tokens, presets, route view transitions, reduced-motion baseline) lives in docs/ai/skills/anim/SKILL.md; read it first.
Rules
- Import path: ESLint bans direct
motion/reactandframer-motionimports. Import from@asym/lib/motion, whosemotionexport is the lazymcomponent; the rootMotionProvider(@asym/lib/motion-provider) suppliesLazyMotionandMotionConfig reducedMotion="user"in every app. - Client-only boundary: Motion requires
'use client'; keep client islands small. - Start simple: Begin with opacity/translate before adding spring physics.
- Use the right tool:
AnimatePresencefor enter/exit andwhileHover/whileTapfor gestures. - No layout or drag features:
MotionProviderloadsdomAnimation, which excludes thelayoutanddragfeatures (they are indomMax). Alayoutordragprop does nothing under it. Animateopacity/transforminstead; loadingdomMaxis a deliberate bundle decision for the shared provider, not a per-component fix. - Respect reduced motion:
MotionConfigalready disables transform and layout animation for reduced-motion users; useuseReducedMotion()when the component needs a different fallback. - Shared timing: Use
@asym/lib/motion-presetsconstants and transitions instead of literal durations and curves.
Workflow
- Identify the UX purpose (feedback, transition, focus).
- Add the smallest
'use client'boundary. - Implement enter/exit or layout transitions correctly.
- Respect reduced motion preferences.
- Check performance and bundle size.
Checklists
Implementation checklist
-
'use client'only where needed - Reduced motion behavior defined
-
AnimatePresencewraps conditional UI - No reliance on
layoutordragprops (not loaded bydomAnimation)
Review checklist
- Animations don’t re-run on every render
- Motion code doesn’t expand the client tree unnecessarily
Minimal examples
Enter/exit
"use client";
import { AnimatePresence, motion } from "@asym/lib/motion";
import { transitionStandard } from "@asym/lib/motion-presets";
export function Toast({
open,
children,
}: {
open: boolean;
children: React.ReactNode;
}) {
return (
<AnimatePresence>
{open ? (
<motion.div
initial={{ opacity: 0, y: 8 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: 8 }}
transition={transitionStandard}
>
{children}
</motion.div>
) : null}
</AnimatePresence>
);
}
Reduced motion
"use client";
import { motion, useReducedMotion } from "@asym/lib/motion";
import { transitionStandard } from "@asym/lib/motion-presets";
export function FadeIn({ children }: { children: React.ReactNode }) {
const reduce = useReducedMotion();
return (
<motion.div
initial={reduce ? false : { opacity: 0, y: 6 }}
animate={reduce ? { opacity: 1 } : { opacity: 1, y: 0 }}
transition={transitionStandard}
>
{children}
</motion.div>
);
}
Common mistakes / pitfalls
- Unmounting without
AnimatePresence(exit animations never run) - Expecting
layoutordragto animate under the shareddomAnimationprovider - Putting Motion in a huge client tree
- Importing from
motion/reactdirectly or adding anotherLazyMotionprovider - Animating large lists without virtualization
Установить motion в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл motion?
Implement smooth, accessible animations with motion/react (Framer Motion) in React. Use when adding animations, gestures, or layout transitions with motion, AnimatePresence, useScroll, and related APIs. Requires a 'use client' boundary; not for strictly server-rendered components or when no animation is needed.
Как установить скилл motion?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл motion запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic