Automated summary
This skill guides implementation of React animations with Framer Motion: scroll-triggered reveals, entrance/exit effects, staggered lists, and prefers-reduced-motion support through useReducedMotion.
Strengths
- Supplies ready-made variants (fadeInUp, staggerContainer, staggerItem, heroEntrance) with consistent easing curves
- Every example wires in useReducedMotion for accessibility
- Covers three concrete patterns: scroll reveals (whileInView + viewport once), staggered lists, and entrance animations without a scroll trigger
- Points to explicit file paths so shared variants stay centralized
Limitations
- The document is cut off: the “4. Index-Based” section is incomplete and the advertised exit animations are never shown
- Referenced paths (apps/web/src/app/about/_components/variants.ts) are project-specific and must be adapted
- The title mentions the motion package v12+ while all imports use framer-motion, which can be confusing
Use it when adding or standardizing entrance and scroll-reveal animations inside an existing React/Next.js application.
Skip it for lightweight pure-CSS effects, complex route transitions, or non-React projects that cannot use Framer Motion.
Security analysis
SafeThe skill only provides Framer Motion animation guidance and code examples. It does not instruct destructive actions, network access, credential handling, obfuscation, or safety bypasses. The declared tools are file-editing/search tools used for legitimate code changes.
No concerns found
How this analysis is madeExamples
Add a scroll-triggered fade-in-up animation to the testimonials section using our shared fadeInUpVariants, with viewport once and reduced-motion support.Animate this feature grid so the cards stagger in on scroll, reusing staggerContainerVariants and staggerItemVariants.Replace the Intersection Observer reveal logic in this component with Framer Motion whileInView, keeping the same timing and respecting prefers-reduced-motion.name: framer-motion-animations description: Create scroll-triggered and entrance animations using Framer Motion (motion package). Use when adding animations, implementing scroll reveals, or migrating from CSS/Intersection Observer. allowed-tools: Read, Edit, Write, Grep, Glob
Framer Motion Animations Skill
This skill helps you implement consistent, accessible animations across the codebase using Framer Motion (motion package v12+).
When to Use This Skill
- Adding scroll-triggered reveal animations
- Implementing entrance/exit animations
- Creating staggered list animations
- Migrating from CSS/Intersection Observer to Motion
- Ensuring accessibility with reduced motion support
Key Files
| File | Purpose |
|------|---------|
| apps/web/src/app/about/_components/variants.ts | Shared animation variants |
| apps/web/src/components/animated-number.tsx | Number animation component |
Animation Variants
Standard Variants (in variants.ts)
import type { Variants } from "framer-motion";
// Base fade-in-up animation for section content
export const fadeInUpVariants: Variants = {
hidden: { opacity: 0, y: 20 },
visible: {
opacity: 1,
y: 0,
transition: { duration: 0.6, ease: [0.16, 1, 0.3, 1] },
},
};
// Container variant for staggered children
export const staggerContainerVariants: Variants = {
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: { staggerChildren: 0.1, delayChildren: 0.1 },
},
};
// Individual stagger item
export const staggerItemVariants: Variants = {
hidden: { opacity: 0, y: 20 },
visible: {
opacity: 1,
y: 0,
transition: { duration: 0.5, ease: [0.4, 0, 0.2, 1] },
},
};
// Hero entrance animation (faster, more dramatic)
export const heroEntranceVariants: Variants = {
hidden: { opacity: 0, y: 24, scale: 0.98 },
visible: {
opacity: 1,
y: 0,
scale: 1,
transition: { duration: 0.8, ease: [0.16, 1, 0.3, 1] },
},
};
Usage Patterns
1. Scroll-Triggered Animation (Single Element)
import { motion, useReducedMotion } from "framer-motion";
import { fadeInUpVariants } from "./variants";
export const Section = () => {
const shouldReduceMotion = useReducedMotion();
return (
<motion.div
variants={shouldReduceMotion ? undefined : fadeInUpVariants}
initial={shouldReduceMotion ? undefined : "hidden"}
whileInView="visible"
viewport={{ once: true, amount: 0.2 }}
>
{/* Content */}
</motion.div>
);
};
2. Staggered List Animation
import { motion, useReducedMotion } from "framer-motion";
import { staggerContainerVariants, staggerItemVariants } from "./variants";
export const FeatureGrid = () => {
const shouldReduceMotion = useReducedMotion();
return (
<motion.div
className="grid grid-cols-2 gap-6"
variants={shouldReduceMotion ? undefined : staggerContainerVariants}
initial={shouldReduceMotion ? undefined : "hidden"}
whileInView="visible"
viewport={{ once: true, amount: 0.2 }}
>
{features.map((feature) => (
<motion.div
key={feature.id}
variants={shouldReduceMotion ? undefined : staggerItemVariants}
>
{/* Feature card */}
</motion.div>
))}
</motion.div>
);
};
3. Entrance Animation (No Scroll Trigger)
import { motion, useReducedMotion } from "framer-motion";
export const HeroSection = () => {
const shouldReduceMotion = useReducedMotion();
// Custom entrance transition with delay
const entranceTransition = (delay: number) =>
shouldReduceMotion
? undefined
: { duration: 1, delay, ease: [0.16, 1, 0.3, 1] as const };
return (
<motion.h1
initial={shouldReduceMotion ? undefined : { opacity: 0, y: 32 }}
animate={{ opacity: 1, y: 0 }}
transition={entranceTransition(0.15)}
>
Headline
</motion.h1>
);
};
4. Index-Based Stagger (Manual Delays)
import { motion, useReducedMotion } from "framer-motion";
interface TimelineItemProps {
index: number;
}
const TimelineItem = ({ index }: TimelineItemProps) => {
const shouldReduceMotion = useReducedMotion();
return (
<motion.div
initial={shouldReduceMotion ? undefined : { opacity: 0, y: 32 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, amount: 0.3 }}
transition={
shouldReduceMotion
? undefined
: { duration: 0.5, delay: index * 0.15, ease: [0.4, 0, 0.2, 1] }
}
>
{/* Content */}
</motion.div>
);
};
5. Number Animation with Viewport Trigger
import { motion, useReducedMotion } from "framer-motion";
import { AnimatedNumber } from "@web/components/animated-number";
import { useState } from "react";
import { staggerItemVariants } from "./variants";
const StatItem = ({ value }: { value: number }) => {
const shouldReduceMotion = useReducedMotion();
const [isInView, setIsInView] = useState(false);
return (
<motion.div
variants={shouldReduceMotion ? undefined : staggerItemVariants}
onViewportEnter={() => setIsInView(true)}
viewport={{ once: true }}
>
{isInView ? <AnimatedNumber value={value} /> : <span>0</span>}
</motion.div>
);
};
Accessibility
Always use useReducedMotion() to respect user preferences:
import { useReducedMotion } from "framer-motion";
const Component = () => {
const shouldReduceMotion = useReducedMotion();
// When reduced motion is preferred:
// - Pass undefined to variants prop
// - Pass undefined to initial prop
// - Pass undefined to transition prop
// - Skip CSS keyframe animations
};
When to Use CSS vs Motion
| Use Case | Recommendation |
|----------|----------------|
| Scroll-triggered reveals | Motion (whileInView) |
| Entrance animations | Motion (initial/animate) |
| Staggered lists | Motion (staggerChildren) |
| Hover states | CSS (Tailwind transition-*) |
| Infinite loops (background effects) | CSS keyframes |
| Simple state transitions | CSS (transition-all) |
Easing Functions
Standard easing curves used in the codebase:
| Name | Value | Use Case |
|------|-------|----------|
| Smooth decelerate | [0.16, 1, 0.3, 1] | Hero entrances, dramatic reveals |
| Standard ease | [0.4, 0, 0.2, 1] | General purpose animations |
Viewport Options
viewport={{
once: true, // Only animate once (recommended)
amount: 0.2, // Trigger when 20% visible
// amount: 0.3, // Trigger when 30% visible (for smaller items)
}}
File Organization
Variants file naming: Use variants.ts (industry standard)
src/app/about/
├── _components/
│ ├── variants.ts # Shared animation variants
│ ├── hero-section.tsx # Uses variants
│ ├── stats-section.tsx # Uses variants + AnimatedNumber
│ └── timeline-section.tsx # Uses variants
Migration from CSS/Intersection Observer
When migrating existing animations:
- Remove
useState(isVisible)+useEffectwithIntersectionObserver - Remove
refpassed to section element - Add
motion.divwithwhileInView - Add
useReducedMotion()check - Import variants from shared file
Before (Intersection Observer):
const [isVisible, setIsVisible] = useState(false);
const sectionRef = useRef<HTMLDivElement>(null);
useEffect(() => {
const observer = new IntersectionObserver(
([entry]) => { if (entry.isIntersecting) setIsVisible(true); },
{ threshold: 0.2 }
);
if (sectionRef.current) observer.observe(sectionRef.current);
return () => observer.disconnect();
}, []);
return (
<div ref={sectionRef} className={isVisible ? "animate-fade-in" : "opacity-0"}>
After (Motion):
const shouldReduceMotion = useReducedMotion();
return (
<motion.div
variants={shouldReduceMotion ? undefined : fadeInUpVariants}
initial={shouldReduceMotion ? undefined : "hidden"}
whileInView="visible"
viewport={{ once: true, amount: 0.2 }}
>
Validation Checklist
When implementing animations:
- [ ] Uses
useReducedMotion()for accessibility - [ ] Passes
undefinedto variants/initial/transition when reduced motion preferred - [ ] Uses shared variants from
variants.tswhere applicable - [ ] Uses
viewport={{ once: true }}for scroll-triggered animations - [ ] Keeps hover states as CSS transitions (not Motion)
- [ ] Uses CSS keyframes for infinite/background animations
Related Files
apps/web/CLAUDE.md- Web app conventionsapps/web/src/app/about/_components/variants.ts- Animation variantsapps/web/src/components/animated-number.tsx- Number animation component
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/framer-motion-animations-mrx3xxnw/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/framer-motion-animations-mrx3xxnw' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/framer-motion-animations-mrx3xxnw/download' --output '.skill-downloads/framer-motion-animations-mrx3xxnw/SKILL.md.part' && mv '.skill-downloads/framer-motion-animations-mrx3xxnw/SKILL.md.part' '.skill-downloads/framer-motion-animations-mrx3xxnw/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
Tools declared by the author (check availability in your agent): Read, Edit, Write, Grep, Glob
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/framer-motion-animations-mrx3xxnw/SKILL.md' && test -s '.skill-downloads/framer-motion-animations-mrx3xxnw/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/framer-motion-animations' && cp -R '.skill-downloads/framer-motion-animations-mrx3xxnw' '.claude/skills/framer-motion-animations'Cursor
test -f '.skill-downloads/framer-motion-animations-mrx3xxnw/SKILL.md' && test -s '.skill-downloads/framer-motion-animations-mrx3xxnw/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/framer-motion-animations' && cp -R '.skill-downloads/framer-motion-animations-mrx3xxnw' '.cursor/skills/framer-motion-animations'Codex
test -f '.skill-downloads/framer-motion-animations-mrx3xxnw/SKILL.md' && test -s '.skill-downloads/framer-motion-animations-mrx3xxnw/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/framer-motion-animations' && cp -R '.skill-downloads/framer-motion-animations-mrx3xxnw' '.agents/skills/framer-motion-animations'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/framer-motion-animations-mrx3xxnw'openskills read 'framer-motion-animations-mrx3xxnw'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/framer-motion-animations-mrx3xxnw/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.