Skip to content
affaan-m avatar

Motion Patterns

Production-ready React and Next.js animation patterns for buttons, modals, toasts, stagger, page transitions, and scroll.

CCM score
73 of 100
skills.sh installs
9K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers button feedback, modals, toast stacks, stagger lists, Next.js App Router page transitions, scroll reveals, and layout animation
  • Includes copy-paste components with AnimatePresence exit handling and layout and layoutId examples for expanding and crossfading elements
  • Enforces a stagger interval between 0.05s and 0.10s, mode="wait" on page transitions, and viewport={{ once: true }} on scroll reveals
  • Designed for React and Next.js projects that already use motion-foundations tokens and springs

Install

$ npx -y skills add affaan-m/ecc --skill motion-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Motion Patterns

Copy-paste patterns for the most common UI animation needs. Every pattern here is built on motion-foundations tokens and springs. Do not define new duration or easing values here — import them.

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

Outputs

This skill produces:

  • Accessible, SSR-safe animation for all standard UI components
  • AnimatePresence-wrapped conditional renders with correct exit behavior
  • Page transition wrapper component for Next.js App Router
  • Scroll-reveal and scroll-linked patterns using useScroll + useTransform
  • Layout animation patterns (layout, layoutId) for expanding and crossfading elements

Principles

Details

Repository
github.com/affaan-m/ecc
Categories
Animation & Motion, Frontend & UI Code
First seen
Jul 14, 2026

Questions

What does the motion-patterns skill do for React and Next.js apps?

The motion-patterns skill gives copy-paste animation patterns for React and Next.js, covering buttons, modals, toasts, stagger lists, page transitions, exit animations, scroll reveals and layout animations. Every pattern draws its duration, easing and spring values from motion-foundations tokens rather than raw numbers.

When should an agent use motion-patterns instead of writing animation code from scratch?

Use it when animating a specific UI element in React or Next.js, such as a button, modal, toast, stagger list, page transition or scroll reveal. The skill includes rules like wrapping conditional renders in AnimatePresence with a key and keeping modals accessible with a focus trap, Escape close and role dialog attributes.

How do I install the motion-patterns skill?

Run npx -y skills add affaan-m/ecc --skill motion-patterns -y inside your project. Once installed, the agent can apply the button, modal, stagger and page transition patterns to your React or Next.js components.

Does motion-patterns depend on motion-foundations?

Yes, every pattern in motion-patterns imports its tokens and springs from motion-foundations, and the skill tells the agent not to define new duration or easing values itself. You need the motion-foundations tokens available in your project, such as the lib motion-tokens file the examples import from.

More from affaan-m/ecc

All 257

Similar to Motion Patterns

More Animation & Motion