On this page
Framer Motion became Motion when the library went independent of Framer. For React apps the move is mostly mechanical: a new package name and a new import path, with the same components and hooks. Here's the whole migration, plus two newer entry points that are worth knowing about once you've switched.
1. Swap the package
npm uninstall framer-motion
npm install motionThe motion package contains the React API alongside Motion's framework-independent animation functions, so it replaces framer-motion entirely. Not sure you need it at all? Motion vs CSS animations helps you decide.
2. Update the imports
Every import from framer-motion becomes an import from motion/react. The names inside the braces stay the same:
// before
import { motion, AnimatePresence, useScroll } from "framer-motion";
// after
import { motion, AnimatePresence, useScroll } from "motion/react";A project-wide find and replace of "framer-motion" with "motion/react" does it in one go. Then run your type checker: if your old version was several major versions behind, a few APIs may have changed between versions, and the errors point straight at them.
3. Use Motion in Server Components
In the Next.js App Router, motion components need to be in a client component. For a simple animated element in an otherwise server-rendered file, Motion has a client entry point you can import from a Server Component directly:
import * as motion from "motion/react-client";
export default function Page() {
return (
<motion.h1 initial={{ opacity: 0, y: 12 }} animate={{ opacity: 1, y: 0 }}>
Welcome
</motion.h1>
);
}Anything that uses hooks, state or event handlers still belongs in its own "use client" component.
4. Optional: load less JavaScript
If bundle size matters, LazyMotion with the lighter m component loads only the animation features you ask for:
"use client";
import { LazyMotion, domAnimation } from "motion/react";
import * as m from "motion/react-m";
export function FadeIn({ children }: { children: React.ReactNode }) {
return (
<LazyMotion features={domAnimation}>
<m.div initial={{ opacity: 0 }} animate={{ opacity: 1 }}>
{children}
</m.div>
</LazyMotion>
);
}domAnimation covers animations, variants, exits and tap and hover gestures; switch to domMax when you also need drag or layout animation.
Copy-paste components already on Motion
Every MotionKit component imports from motion/react, so it drops into a migrated project as is: copy the file, or install it with the shadcn CLI, and it uses the same Motion package as the rest of your app.
Questions
Is Motion the same library as Framer Motion?
Yes. It's the same library under a new name, maintained by the same author, now independent of Framer.
Do I need to rewrite my animations?
No. Components, props and hooks keep their names; you change the package and the import path.
What is the difference between motion/react and motion/react-client?
motion/react is the full React API for client components. motion/react-client exports the motion components in a form you can import from a Next.js Server Component file.
Does Motion work with React 19?
Yes. Current versions of Motion support React 19.