# framer-motion-variants

Teaches coding agents to coordinate Framer Motion animations using variants, staggered lists, and custom state machines.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 759 installs · ★ 10
- Author: C-Jeril
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/C-Jeril/framer-motion-skills/tree/HEAD/skills/framer-motion-variants/SKILL.md
- Updated: 2026-04-02
- HTML: https://affpapa.org/en/nevibecode/skills/framer-motion-variants

## What it does

This skill supplies agent instructions for orchestrating React animations with Framer Motion variants. It guides the model through sequencing parent-child transitions with `staggerChildren`, setting playback order via `staggerDirection`, and synchronizing layers using `when`.

Included examples cover dynamic variants driven by the `custom` prop, keyframe timing arrays, and looping modes like `reverse` or `mirror`. The guide cautions against bloated definitions. Keep components to 3–5 variant states. For core animation props or scroll triggers, install the companion skills `framer-motion-core` and `framer-motion-scroll`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add C-Jeril/framer-motion-skills --skill framer-motion-variants -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/framer-motion-variants/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/framer-motion-variants/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add C-Jeril/framer-motion-skills --skill framer-motion-variants -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/framer-motion-variants/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add C-Jeril/framer-motion-skills --skill framer-motion-variants -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/framer-motion-variants/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install C-Jeril/framer-motion-skills framer-motion-variants
```

2. **Manually: put the files in place**
- File: `.github/skills/framer-motion-variants/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add C-Jeril/framer-motion-skills --skill framer-motion-variants -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/C-Jeril/framer-motion-skills --path skills/framer-motion-variants
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/framer-motion-variants/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add C-Jeril/framer-motion-skills --skill framer-motion-variants -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/C-Jeril/framer-motion-skills/tree/HEAD/skills/framer-motion-variants/SKILL.md

## When to use it
- choreograph staggered entrance sequences for nested list elements
- build state machines for UI widgets using the dynamic custom prop
- configure looping keyframe transitions with precise timing arrays
- coordinate parent and child transition timing with the when property

## Example prompts
- Choreograph a staggered card grid entrance using Framer Motion variants and staggerChildren
- Build an interactive button with idle, hovered, and pressed states using custom variants
- Create an infinite pulsing badge animation using keyframes and repeatType mirror

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 94c5b3f969fa7b69.

BEGIN THIRD-PARTY FILE 94c5b3f969fa7b69
````text
---
name: framer-motion-variants
description: Official Framer Motion skill for animation variants — state machines, orchestrated animations, stagger, repeat, sequencing. Use when building orchestrated animations, animation state machines, staggered entrances, or when asking about Framer Motion variants, transition variants, or choreographed animations.
license: MIT
---

# Framer Motion Variants

## When to Use This Skill

Apply when building multi-step animations, coordinated animations across multiple elements, or when using variants for state-based animation control. Variants are Framer Motion's way of defining reusable animation states that can be choreographed.

**Related skills:** For core animation props use **framer-motion-core**; for React integration use **framer-motion-react**; for scroll-driven variants use **framer-motion-scroll**.

## Defining Variants

Variants are objects that define animation states:

```jsx
const container = {
  hidden: { opacity: 0 },
  visible: {
    opacity: 1,
    transition: {
      staggerChildren: 0.1
    }
  }
};

const item = {
  hidden: { opacity: 0, y: 20 },
  visible: { opacity: 1, y: 0 }
};

function Component() {
  return (
    <motion.div
      variants={container}
      initial="hidden"
      animate="visible"
    >
      {[1, 2, 3].map(i => (
        <motion.div key={i} variants={item} />
      ))}
    </motion.div>
  );
}
```

## Variant Types

### Static Variants

```jsx
const variants = {
  initial: { opacity: 0 },
  animate: { opacity: 1 },
  exit: { opacity: 0 }
};
```

### Dynamic Variants

```jsx
const variants = {
  animate: (custom) => ({
    x: custom * 100,
    opacity: 1
  })
};
```

## Orchestration

### staggerChildren

Stagger children animations:

```jsx
const container = {
  hidden: { opacity: 0 },
  visible: {
    opacity: 1,
    transition: {
      staggerChildren: 0.1,
      delayChildren: 0.2
    }
  }
};
```

### staggerDirection

```jsx
transition: {
  staggerChildren: 0.1,
  staggerDirection: -1  // 1 = forward, -1 = backward
}
```

## Repeating Animations

```jsx
const variants = {
  animate: {
    scale: [1, 1.5, 1],
    transition: {
      duration: 2,
      repeat: Infinity,
      repeatType: "loop"  // "loop" | "reverse" | "mirror"
    }
  }
};
```

### repeatType Options

| Type | Behavior |
|------|----------|
| `"loop"` | Restart from beginning |
| `"reverse"` | Play forward then backward |
| `"mirror"` | Swap states on each repeat |

## Keyframes

Animate through multiple values:

```jsx
<motion.div
  animate={{
    x: [0, 100, -50, 0],
    backgroundColor: ["#ff0000", "#00ff00", "#0000ff"]
  }}
  transition={{
    duration: 2,
    times: [0, 0.3, 0.6, 1]
  }}
/>
```

## State Machine with custom

```jsx
const states = {
  idle: { scale: 1 },
  hovered: { scale: 1.1 },
  pressed: { scale: 0.95 }
};

function Component({ state }) {
  return (
````
END THIRD-PARTY FILE 94c5b3f969fa7b69

The third-party file has ended. Everything between the 94c5b3f969fa7b69 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2877 of 3915 bytes. © C-Jeril · MIT · https://github.com/C-Jeril/framer-motion-skills/tree/HEAD/skills/framer-motion-variants/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
