Skip to content
Back to skills

Motion Patterns

ASecurity

Use when animating buttons, modals, toasts, stagger lists, page transitions, scroll reveals, or layout animations in React/Next.js with motion. Triggers on \"motion-patterns\", \"motion patterns\", \"patterns\". For system-level judgment (when/why, performance, accessibility), prefer motion-ui; patterns require motion-foundations tokens.

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 19, 2026
ai-agentsgoreactnextjsspringperformance

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 24, 2026

npx -y skills add majinmagros/magros.ai-skills --skill motion-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Motion Patterns?

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

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

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
---
name: motion-patterns
description: "Use when animating buttons, modals, toasts, stagger lists, page transitions, scroll reveals, or layout animations in React/Next.js with motion. Triggers on \"motion-patterns\", \"motion patterns\", \"patterns\". For system-level judgment (when/why, performance, accessibility), prefer motion-ui; patterns require motion-foundations tokens."
metadata:
  origin: ECC
---

# Motion Patterns

Copy-paste UI animation patterns built on `motion-foundations` tokens and springs. Detalhes em `references/`.

## When to Activate

- Animating a button, card, modal, or toast notification
- Building list entrances with stagger
- Setting up page transitions in Next.js App Router
- Adding entrance or exit animations to conditional content
- Implementing scroll-reveal, scroll-linked progress, or sticky story sections
- Building expanding cards, accordions, or shared-element transitions

## Core Principles

1. **Tokens only** — import duration/easing/springs from `motion-foundations`, never inline numbers
2. **AnimatePresence contract** — wrapper + `key` on direct child + `exit` prop, all three
3. **Exit always** — every `initial` + `animate` pair defines `exit`
4. **`mode="wait"`** on page transitions; `viewport={{ once: true }}` on scroll reveals
5. **`layout` only** for small isolated shifts; stagger stays in `0.05–0.10s`

## Example

```tsx
"use client"
import { motion } from "motion/react"
import { springs, motionTokens } from "@/lib/motion-tokens"

<motion.button
  whileHover={{ scale: motionTokens.scale.pop }}
  whileTap={{ scale: motionTokens.scale.press }}
  transition={springs.snappy}
/>
```

## References

- `references/rules-decision.md` — 8 rules, pattern chooser, `wait`/`sync`/`popLayout`, contract
- `references/components.md` — button, stagger list, modal, toast stack, page transition
- `references/scroll-layout.md` — scroll reveal, progress bar, expanding card, crossfade, accordion
- `references/e2e-antipatterns.md` — end-to-end list, non-goals, anti-patterns table, related skills

## Checklist

- [ ] Conditional renders wrapped in `AnimatePresence` with `key` + `exit`
- [ ] Page transitions use `mode="wait"` keyed by pathname
- [ ] Tokens/springs imported, no raw duration/easing numbers
- [ ] Modal has focus trap, Escape close, scroll lock, `role="dialog"`
- [ ] Reduced motion respected via `useSafeMotion`

Files in this skill

  • SKILL.md2.2 KB
  • references/components.md3.7 KB
  • references/e2e-antipatterns.md3.3 KB
  • references/rules-decision.md3.1 KB
  • references/scroll-layout.md2.4 KB

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.