Skip to content
Skills Library
Design & UX · Building & coding

framer-motion-animations

/framer-motion-animations

Use this skill when implementing declarative physics-based micro-interactions, layout transitions, gestures, and exit animations in React.

Licence
MIT
Last repository change
28.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use this skill when implementing declarative physics-based micro-interactions, layout transitions, gestures, and exit animations in React.

Original author description

Use this skill when implementing declarative physics-based micro-interactions, layout transitions, gestures, and exit animations in React.

How it works

  1. When to use
  2. Prerequisites
  3. Step-by-step workflow
  4. Commands / code examples
  5. Common mistakes & pitfalls
  6. Verification checklist
  7. Related skills
Original SKILL.md headings · 71 lines, 344 words
SKILL.md preview
---
name: framer-motion-animations
description: Use this skill when implementing declarative physics-based micro-interactions, layout transitions, gestures, and exit animations in React.
---
# Framer Motion Animations

## When to use
Use this skill when building fluid UI animations in React, handling enter/exit transitions, animating modal dialogs, or creating drag-and-drop gestures.

## Prerequisites
- React 18+ project environment.
- `framer-motion` package installed (`npm install framer-motion`).

## Step-by-step workflow
1. **Convert to motion elements**: Replace standard HTML tags with motion equivalents (e.g., `motion.div`, `motion.button`).
2. **Define animate states**: Use `initial`, `animate`, and `exit` props or named `variants` for clean state transitions.
3. **Configure physics transitions**: Set `transition={{ type: 'spring', stiffness: 300, damping: 25 }}` for natural movement.
4. **Handle exit animations**: Wrap conditional components with `<AnimatePresence>` providing a unique `key` to each child.
5. **Respect reduced motion**: Check user system preferences with `useReducedMotion()` and suppress motion for sensitive users.

## Commands / code examples
```tsx
import React from 'react';
import { motion, AnimatePresence, useReducedMotion } from 'framer-motion';

interface ToastProps {
  id: string;
  message: string;
  onDismiss: () => void;
}

export const Toast: React.FC<ToastProps> = ({ message, onDismiss }) => {
  const shouldReduceMotion = useReducedMotion();

  const variants = {
    initial: { opacity: 0, y: shouldReduceMotion ? 0 : 20, scale: 0.95 },
    animate: { opacity: 1, y: 0, scale: 1 },
    exit: { opacity: 0, scale: 0.9, transition: { duration: 0.15 } },
  };

  return (
    <motion.div
      variants={variants}
      initial="initial"
      animate="animate"
      exit="exit"
      transition={{ type: 'spring', stiffness: 400, damping: 30 }}
      className="bg-gray-900 text-white p-4 rounded-lg shadow-xl flex items-center justify-between"
    >
      <span>{message}</span>
      <button onClick={onDismiss} className="ml-4 text-sm text-gray-400 hover:text-white">
        Close
      </button>
    </motion.div>
  );
};
```

## Common mistakes & pitfalls
- Forgetting to provide a stable, unique `key` to children of `<AnimatePresence>`, breaking exit animation detection.
- Animating non-performant properties like `width`, `height`, or `top` instead of GPU-accelerated `transform` and `opacity`.
- Neglecting `useReducedMotion()`, triggering vestibular disorders for sensitive users.

## Verification checklist
- [ ] Animations primarily animate `transform` and `opacity` properties.
- [ ] Exit transitions are wrapped inside `<AnimatePresence>`.
- [ ] Reduced motion preferences are checked via `useReducedMotion()`.
- [ ] Spring physics parameters produce natural, non-oscillating settling.

## Related skills
- react-fundamentals
- react-hooks-patterns
- shadcn-ui-radix-primitives
- wcag-22-guidelines-conformance-levels

Versions

The database has no other skills named framer-motion-animations.

Database snapshot: 13.11.2026 · package version a8cde43f728f (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 91motion-framer
    Use when implementing Motion or Framer Motion in React/JavaScript: interactive UI components, micro-interactions, gestures, layout or page transitions, and scroll-based animation. Do not use for static styling, backend/API work, or animation in another runtime unless…
  • 90framer-motion-animator
    Creates smooth animations and micro-interactions using Framer Motion including page transitions, gestures, scroll-based animations, and orchestrated sequences. Use when users request "add animation", "framer motion", "page transition", "animate component", or "micro-interactions".
  • 100react-motion
    Build UI animation in React/Next.js with Motion for React (formerly Framer Motion) — micro-interactions, enter/exit with AnimatePresence, layout and shared-element animations, gestures (hover, tap, drag), scroll-linked values, staggered lists, modals, tabs, menus, and page…
  • 100motion-design
    Use when implementing motion design — page transitions, element animations, micro-interactions, layout animations. Covers Motion (ex Framer Motion), View Transitions API, auto-animate, SVG animation (Rive, Lottie), and accessibility.
  • 100framer-motion
    Framer Motion performance optimization guidelines. This skill should be used when writing, reviewing, or refactoring React animations with Framer Motion to ensure optimal performance patterns. Triggers on tasks involving motion components, animations, gestures, layout…
  • 100framer-motion
    Use when implementing Disney's 12 animation principles with Framer Motion in React applications

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.