npx skills add ...
npx skills add freshtechbro/claudedesignskills --skill motion-framer
Modern animation library for React and JavaScript. Create smooth, production-ready animations with motion components, variants, gestures (hover/tap/drag), layout animations, AnimatePresence exit animations, spring physics, and scroll-based effects. Use when building interactive UI components, micro-interactions, page transitions, or complex animation sequences.
npx skills add freshtechbro/claudedesignskills --skill motion-framer
Motion (formerly Framer Motion) is a production-ready animation library for React and JavaScript that enables declarative, performant animations with minimal code. It provides motion components that wrap HTML elements with animation superpowers, supports gesture recognition (hover, tap, drag, focus), and includes advanced features like layout animations, exit animations, and spring physics.
When to use this skill:
Technology:
Convert any HTML/SVG element into an animatable component by prefixing with motion.:
Every motion component accepts animation props like animate, initial, transition, and gesture props like whileHover, whileTap, etc.
The animate prop defines the target animation state. When values change, Motion automatically animates to them:
Set the initial state before animation using the initial prop:
Set initial={false} to disable initial animations on mount.
Control how animations move between states using the transition prop:
Transition types:
"tween" (default) - Duration-based with easing"spring" - Physics-based spring animation"inertia" - Decelerating animation (used in drag)Organize animation states using named variants for cleaner code and propagation to children:
Variant propagation - Children automatically inherit parent variant states:
Animate on hover using whileHover prop:
Hover with nested elements:
Animate on tap/press using whileTap prop:
Make elements draggable with the drag prop:
Drag events:
Animate components when they're removed from the DOM using AnimatePresence:
Key requirements:
<AnimatePresence>key propexit prop to define exit animationList items with exit animations:
Staggered exit animations:
Automatically animate layout changes (position, size) with the layout prop:
Grid layout animation:
Shared layout animations (layoutId):
Connect two different elements for smooth transitions using layoutId:
Animate elements when they enter the viewport using whileInView:
Viewport options:
once: true - Animation triggers only onceamount: 0.5 - Percentage of element visible (0-1) or "some" | "all"margin: "-100px" - Offset viewport boundariesStaggered scroll animations:
Use spring physics for natural, bouncy animations:
Spring presets:
stiffness: 100, damping: 20stiffness: 200, damping: 10stiffness: 400, damping: 30stiffness: 50, damping: 20Motion provides declarative gesture handlers:
Event info objects contain:
point: { x, y } - Page coordinatesoffset: { x, y } - Offset from drag startvelocity: { x, y } - Drag velocityManually control animations with the useAnimate hook:
Animation controls:
Create spring-animated motion values:
Detect when an element is in viewport:
Combine Motion for React state-based animations and GSAP for complex timelines:
Animate 3D objects using Motion values:
Animate form validation states:
Transform properties (x, y, scale, rotate) are hardware-accelerated:
Motion supports individual transform properties for cleaner code:
Respect user preferences for reduced motion:
Layout animations can be expensive. Optimize with:
layoutId creates shared layout animations but tracks elements globally. Use only when needed.
Problem: Exit animations don't work
Problem: AnimatePresence can't track elements
Problem: Janky animations, poor performance
Problem: Performance issues with many layout-animated elements
Problem: Duplicated animation code, no child orchestration
Problem: Transitions don't apply to specific gestures
This skill includes:
references/
api_reference.md - Complete Motion API referencevariants_patterns.md - Variant patterns and orchestrationgesture_guide.md - Comprehensive gesture handling guidescripts/
animation_generator.py - Generate Motion component boilerplatevariant_builder.py - Interactive variant configuration toolassets/
starter_motion/ - Complete Motion + Vite starter templateexamples/ - Real-world Motion component patterns