motion-framer

Create React UI animations with motion components, variants, and gestures.

Updated Nov 21, 2024
One-click install
npx skills add https://github.com/TenBeltz/tenbeltz-frontend --skill motion-framer-tenbeltz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: motion-framer
Source: https://github.com/TenBeltz/tenbeltz-frontend/tree/main/.agents/skills/motion-framer
Command: npx skills add https://github.com/TenBeltz/tenbeltz-frontend --skill motion-framer-tenbeltz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Complex UI animations in React and JavaScript can be brittle and hard to orchestrate. Motion (Framer Motion) provides declarative, production-ready primitives that simplify creating smooth, high-performance animations across components and screens.

Core Features & Use Cases

  • Motion components for HTML/SVG elements with animate, initial, exit, and layout capabilities
  • Gesture support (hover, tap, drag, focus) and layout animations for dynamic interfaces
  • Variants, layoutId, AnimatePresence, and scroll-based animations to orchestrate complex sequences
  • React 18+ compatibility with optional TypeScript typings and broad toolchain support (Next.js, Vite, etc.)
  • Real-world patterns for modals, forms, and shared element transitions

Quick Start

Install the library and start by importing motion from framer-motion and wrapping elements with motion.div to begin animating.

Frequently Asked Questions about motion-framer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I animate React components when they mount and unmount?

React component mount and unmount animations use AnimatePresence to orchestrate exit animations before removal. Wrap elements with motion components and define initial, animate, and exit properties to create smooth transitions as components enter and leave the DOM.

What is the best way to handle drag and gesture interactions in React?

Drag and gesture interactions in React are handled using built-in motion component props for hover, tap, drag, and focus events. These declarative props enable interactive UI components without manual event listener management.

Can I use Framer Motion with Next.js and TypeScript?

Framer Motion works with Next.js, Vite, and React 18+ environments, offering optional TypeScript typings. It provides broad toolchain compatibility for integrating motion components into existing React build setups.

How do I orchestrate complex sequential UI animations in React?

Sequential UI animations in React are orchestrated using variants and layoutId to coordinate animations across multiple components. This allows complex choreography and shared element transitions to propagate through the component tree.

Why do my React layout animations shift unexpectedly?

React layout animations shift when elements lack proper layout properties or spring physics configurations. Using motion components with layout capabilities ensures the browser animates positional changes smoothly rather than snapping to new positions.

Do I need spring physics for scroll-based React animations?

Spring physics are optional for scroll-based React animations but provide natural motion. Scroll-based effects can use motion components to link scroll position to animation values, creating smooth layout transitions.