Communitygithub.com

Motion (Framer Motion) — 스킬

React에서 motion/react를 사용하여 부드럽고 접근성 있는 애니메이션을 구현합니다. 애니메이션, 제스처, 레이아웃 전환을 추가할 때 사용합니다. 'use client' 경계가 필요하며, 순수 서버 렌더링 컴포넌트나 애니메이션이 필요 없는 경우에는 사용하지 마십시오.

Motion (Framer Motion) — 스킬란 무엇인가요?

이 스킬은 React 애플리케이션에서 Framer Motion(motion/react) 라이브러리를 사용하여 부드럽고 접근성 있는 애니메이션을 구현하는 방법을 제공합니다. 애니메이션, 제스처, 레이아웃 전환을 추가해야 할 때 사용하며, Framer Motion은 강력한 API(motion, AnimatePresence, useScroll 등)를 통해 진입/퇴장 애니메이션, 레이아웃 애니메이션, 제스처(whileHover, whileTap) 등을 지원합니다. 클라이언트 전용 라이브러리이므로 반드시 'use client' 경계 내에서 사용해야 하며, 서버 렌더링 컴포넌트에서는 사용할 수 없습니다. 또한 useReducedMotion() 훅을 사용하여 사용자의 동작 감소 설정을 존중해야 합니다. 성능과 번들 크기를 고려하여 LazyMotion을 사용하거나 클라이언트 트리를 최소화하는 것이 중요합니다. 이 스킬은 Claude Code, Cursor, Codex 등 다양한 AI 에이전트 플랫폼에서 참조할 수 있는 구조화된 지침을 제공합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Asymmetric-al/core/tree/HEAD/.agents/skills/motion

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Motion (Framer Motion) — 스킬은(는) 무엇을 하나요?

이름: motion 목적: React에서 motion/react를 사용하여 부드럽고 접근성 있는 애니메이션을 구현합니다. 애니메이션, 제스처 또는 레이아웃 전환을 추가할 때 이 스킬을 사용하세요.

적용 대상: motion/react (motion, AnimatePresence, useScroll 등)를 사용할 때. 사용하지 말아야 할 경우: 애니메이션이 필요 없거나 컴포넌트가 순수 서버 렌더링될 때.

규칙

  • 클라이언트 전용 경계: Motion은 'use client'가 필요합니다. 클라이언트 섬을 작게 유지하세요.
  • 간단하게 시작: 스프링 물리학을 추가하기 전에 먼저 opacity/translate로 시작하세요.
  • 올바른 도구 사용: 진입/퇴장에는 AnimatePresence, 레이아웃에는 layout, 제스처에는 whileHover/whileTap을 사용하세요.
  • 동작 감소 설정 존중: useReducedMotion()을 사용하세요.
  • 번들 크기 관리: 큰 모션 표면에는 LazyMotion을 사용하세요.

워크플로우

  1. UX 목적(피드백, 전환, 포커스)을 식별합니다.
  2. 가장 작은 'use client' 경계를 추가합니다.
  3. 진입/퇴장 또는 레이아웃 전환을 올바르게 구현합니다.
  4. 동작 감소 설정을 존중합니다.
  5. 성능과 번들 크기를 확인합니다.

체크리스트

구현 체크리스트

  • 'use client'가 필요한 곳에만 사용
  • 동작 감소 동작 정의됨
  • AnimatePresence가 조건부 UI를 래핑
  • 레이아웃 전환에 layout 사용

리뷰 체크리스트

  • 애니메이션이 모든 렌더링에서 다시 실행되지 않음
  • Motion 코드가 불필요하게 클라이언트 트리를 확장하지 않음

최소 예제

진입/퇴장

"use client";

import { AnimatePresence, motion } from "motion/react";

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={{ duration: 0.18 }}
        >
          {children}
        </motion.div>
      ) : null}
    </AnimatePresence>
  );
}

레이아웃 애니메이션

"use client";

import { motion } from "motion/react";

export function Expander({ open }: { open: boolean }) {
  return (
    <motion.div layout className="overflow-hidden rounded-md border p-3">
      <div className="font-medium">제목</div>
      {open ? <div className="mt-2 text-sm">더 많은 내용...</div> : null}
    </motion.div>
  );
}

동작 감소 설정

"use client";

import { motion, useReducedMotion } from "motion/react";

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={{ duration: 0.2 }}
    >
      {children}
    </motion.div>
  );
}

일반적인 실수 / 함정

  • AnimatePresence 없이 언마운트하기 (종료 애니메이션이 실행되지 않음)
  • layout 없이 레이아웃 애니메이션 적용
  • Motion을 거대한 클라이언트 트리에 배치
  • 가상화 없이 큰 목록에 애니메이션 적용

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

Asymmetric-al/core

Build animations for Expo and React Native only, using Reanimated, Gesture Handler, Expo Router, and expo-haptics. Use when the target runtime is an Expo or React Native app. Do not use it for Core Next.js web motion; use `animate` for web. Only runs when explicitly invoked; it does not trigger on its own.

Asymmetric-al/core

Build an animation from scratch, making the decisions in the order that determines whether it feels right — should it animate at all, what purpose, which tool, which properties, which curve and duration, how it interrupts, how it exits. Writes the implementation. Use when asked to animate something, add motion, make a component feel alive, or build a transition. For critiquing existing motion use review-animations; for auditing a whole codebase use improve-animations. Only runs when explicitly invoked; it does not trigger on its own.

Asymmetric-al/core

Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.

Asymmetric-al/core

Inspect a Core UI or code surface for a small number of justified motion opportunities and explicitly identify what should remain static. Use when asked what should animate, where motion would improve feedback or comprehension, how to make an interface feel more alive without over-animating it, or whether a proposed animation is worth adding. Read-only; do not use to review or fix existing motion code or to implement animations.

Asymmetric-al/core

Survey a codebase's animation and motion code as a senior motion advisor, then produce a prioritized audit and self-contained implementation plans for other agents (or cheaper models) to execute. Read-only on source code — it plans improvements, it does not apply them. Use when the user asks to "improve the animations", "audit the motion", "make this app feel better", or wants a roadmap of animation fixes rather than a review of a single diff.

Asymmetric-al/core

Best practices for Remotion - Video creation in React

Asymmetric-al/core

Reviews animation and motion code against a high craft bar derived from Emil Kowalski's design engineering philosophy. Default to flagging; approval is earned.

관련 스킬