Skip to content
Back to skills

Motion

ASecurity

**Name:** `motion` **Purpose:** Implement smooth, accessible animations with `motion/react` in React. Use this skill whenever adding animations, gestures, or layout transitions. **Applies when:** Using `motion/react` (`motion`, `AnimatePresence`, `useScroll`, etc.). **Do not use when:** No animations are needed or the component is strictly server-rendered.

  • 383 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added June 6, 2026
designreactnodespringperformance

Works with

  • cli

Security analysis

A100/100

Scanned June 6, 2026

npx -y skills add Asymmetric-al/core --skill motion --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Motion?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Motion
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/asymmetric-al-motion/badge)](https://www.skillsdirectory.com/skills/asymmetric-al-motion)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Motion (Framer Motion) — Skill

**Name:** `motion`
**Purpose:** Implement smooth, accessible animations with `motion/react` in React.
Use this skill whenever adding animations, gestures, or layout transitions.

**Applies when:** Using `motion/react` (`motion`, `AnimatePresence`, `useScroll`, etc.).
**Do not use when:** No animations are needed or the component is strictly server-rendered.

## Rules

- **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:** `AnimatePresence` for enter/exit, `layout` for layout, `whileHover`/`whileTap` for gestures.
- **Respect reduced motion:** Use `useReducedMotion()`.
- **Bundle discipline:** Use `LazyMotion` for larger motion surfaces.

## Workflow

1. Identify the UX purpose (feedback, transition, focus).
2. Add the smallest `'use client'` boundary.
3. Implement enter/exit or layout transitions correctly.
4. Respect reduced motion preferences.
5. Check performance and bundle size.

## Checklists

### Implementation checklist

- [ ] `'use client'` only where needed
- [ ] Reduced motion behavior defined
- [ ] `AnimatePresence` wraps conditional UI
- [ ] Layout transitions use `layout`

### Review checklist

- [ ] Animations don’t re-run on every render
- [ ] Motion code doesn’t expand the client tree unnecessarily

## Minimal examples

### Enter/exit

```tsx
"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>
  );
}
```

### Layout animation

```tsx
"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">Title</div>
      {open ? <div className="mt-2 text-sm">More content...</div> : null}
    </motion.div>
  );
}
```

### Reduced motion

```tsx
"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>
  );
}
```

## Common mistakes / pitfalls

- Unmounting without `AnimatePresence` (exit animations never run)
- Animating layout without `layout`
- Putting Motion in a huge client tree
- Animating large lists without virtualization

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…