Production-grade Animationen für React (Spring, Layout, Gesten).
Framer Motion ist die Production-Animation-Library für React — Springs, Gestures, Layout-Animationen, Variants, AnimatePresence. Default-Choice für UI-Animationen mit Polish.
pnpm add framer-motion
import { motion, AnimatePresence } from 'framer-motion'
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ type: 'spring', stiffness: 200 }}
/>
<AnimatePresence> für Exit-Animationen beim Unmount:
<AnimatePresence>
{open && <motion.div exit={{ opacity: 0 }} />}
</AnimatePresence>
layout-Prop für magische Layout-Animationen ohne FLIP-Manual.staggerChildren.useScroll + useTransform für Scroll-Linked-Animations.useMotionValue für imperative Updates ohne Re-Render.<AnimatePresence> braucht stabile key auf Kindern, sonst kein Exit.layout-Animationen können teuer sein — viele animierte Items → Performance-Bottleneck."use client".whileHover/whileTap auf Touch-Devices: kein Hover — explizit handhaben.Für komplexe Timelines, ScrollTrigger-Choreografien oder SVG-Morphing → GSAP. Reine CSS-Transitions ohne Logik → Tailwind transition-* reicht.