Framer Motion vs CSS Animations in React: Which Should You Use in 2026?
15 min··Updated
When to use CSS animations and when to use Framer Motion (now Motion) in React, covering scroll animations, View Transitions, exit and layout animations, performance, Tailwind CSS and GSAP.
How to Recreate Apple's Scroll Animations in React
How Apple's scroll-driven product pages work, and how to build the same scroll animation in React with an image sequence on canvas, GSAP ScrollTrigger or a free ready-made component.
Read article
17 min
How to Optimize a Next.js App in 2026: The Next.js 16 Performance Guide
A practical Next.js 16 performance guide: Core Web Vitals, the bundle analyzer, Server Components, next/image, next/font, next/script, Cache Components, the React Compiler and SEO, with the real setup behind a production Next.js site.
Read article
← Previous article
18 min
10 Best React UI Component Libraries in 2026 (Free and Paid)
Next article →
15 min
How to Recreate Apple's Scroll Animations in React
Use CSS animations for motion that never needs to know about your React state: hovers, focus rings, fades, loading spinners and scroll effects. Use Framer Motion, which is now called Motion, when an animation has to follow state, survive an interruption, animate a component out before React removes it, or move an element smoothly to a new place in the layout. Most production React apps use both, and the skill is knowing which job belongs to which tool.
The line between them moved a lot in the last two years. CSS gained scroll-driven animations, the View Transitions API, @starting-style for entry and exit effects, and a linear() easing function that can fake a spring. React 19.3 added a <ViewTransition> component. Framer Motion was renamed to Motion and now runs most animations through the browser's own animation engine. This guide covers what each side does best in 2026, what still needs JavaScript, how they compare on performance, and where Tailwind CSS and GSAP fit in.
Framer Motion vs CSS animations at a glance
Use CSS animations when
Use Framer Motion (Motion) when
It is a hover, focus or simple on and off state.
The animation follows React state, props or live data.
It is a loading spinner, pulse or looping effect.
A component must animate out before it unmounts.
It is a scroll progress bar or a reveal on scroll.
An element should glide to its new position when layout changes.
It is a page transition in a simple app.
Users drag, swipe or flick something with real physics.
You want zero JavaScript added to the bundle.
The motion must stay smooth when interrupted halfway.
Framer Motion is now Motion: what changed
In late 2024 Framer Motion became an independent project called Motion, documented at motion.dev. The React part is now "Motion for React", and the old framer-motion package is still published alongside the new motion package, both at version 14.1.0 as of October 2026. Together they get over 75 million npm downloads a week.
For a new project, install the new package and import from motion/react:
Source
npm install motion
Source
import{ motion }from"motion/react";
If you already use framer-motion, nothing breaks. Moving over is a matter of swapping the package and changing imports from "framer-motion" to "motion/react". In the Next.js App Router, files that use motion from motion/react need the "use client" directive, or you can import from motion/react-client to use motion components without turning the whole file into a client component.
The bigger change is under the hood. Motion now runs animations natively through the Web Animations API and ScrollTimeline when it can, and only falls back to JavaScript for things the browser cannot do itself, like spring physics, interruptible keyframes and gesture tracking. That narrows the performance gap with plain CSS considerably.
What CSS animations do best
CSS transitions for hovers and state changes
A CSS transition animates a property from one value to another whenever it changes. It is the right tool for hovers, focus states, toggles and anything else that moves between two known states. It adds no JavaScript at all.
Transitions also handle interruption better than many people think. If a user hovers off halfway through, the transition reverses from wherever it currently is instead of jumping back to the start. What it cannot do is carry the momentum of that movement into the reversal, which is where a spring feels more natural.
CSS keyframes for loops and sequences
Keyframe animations, written with @keyframes, run a sequence of steps on their own, with no state change needed. Spinners, shimmer effects, pulsing dots and attention cues are all keyframe work.
The linear() easing function takes a list of points, which lets you draw a curve that overshoots and settles like a spring. It works in Chrome 113, Firefox 112, Safari 17.2 and newer, and tools can generate the point list for you. It is a good fit for one-off springy entrances. It is still a fixed curve with a fixed duration, so it will not react to how fast the user was moving.
Entry and exit animations with @starting-style
CSS can now animate an element as it appears and as it is hidden with display: none, which makes dialogs, popovers and dropdowns possible without JavaScript. @starting-style sets the values to animate from on first render, and transition-behavior: allow-discrete lets display itself take part in the transition. Both work in Chrome 117, Firefox 129 and Safari 17.5 or newer.
There is one important limit. This works when an element stays in the page and is hidden. When React unmounts a component, its DOM node is removed at once, and plain CSS never gets the chance to animate it out.
CSS scroll animations without JavaScript
Scroll-driven animations tie an animation's progress to scrolling instead of time, with no scroll listener and no IntersectionObserver. animation-timeline: scroll() follows the scroll position of a container, and animation-timeline: view() follows an element as it moves through the viewport.
A reading progress bar that fills as the page scrolls takes a few lines:
Source
.progress-bar{
transform-origin: left;
animation: grow linear both;
animation-timeline:scroll(root);
}
@keyframes grow{
from{transform:scaleX(0);}
to{transform:scaleX(1);}
}
An element that fades in as it enters the viewport uses view() and animation-range to control when the effect starts and ends:
Source
.reveal{
animation: fade-up linear both;
animation-timeline:view();
animation-range: entry 0% cover 30%;
}
@keyframes fade-up{
from{opacity:0;transform:translateY(24px);}
to{opacity:1;transform:translateY(0);}
}
Browser support is the catch. As of October 2026, scroll-driven animations work in Chrome and Edge 115 and newer and in Safari 26, but Firefox still has them only in preview builds, not in its stable release. Wrap them in @supports (animation-timeline: scroll()) so Firefox users simply see the finished state, or use Motion's useScroll when the effect has to work everywhere.
The View Transitions API
The View Transitions API animates between two states of the page. The browser takes a snapshot of the old view, applies your update, and cross-fades or morphs to the new view. Give two elements the same view-transition-name and the browser animates one into the other, even if they live in completely different parts of the DOM.
Source
document.startViewTransition(()=>{
updateTheDom();
});
Same-page view transitions, the document.startViewTransition() kind, now work in every major browser: Chrome 111, Safari 18 and Firefox 144 or newer. Transitions between separate pages, turned on with the @view-transition rule in CSS, work in Chrome 126 and Safari 18.2 but not yet in Firefox.
React 19.3 includes a <ViewTransition> component that drives this API for you. Wrap part of your tree in it, make the update inside startTransition, and React plays enter, exit and update animations as components mount, unmount or move. That means a component can now animate out as React removes it, using CSS and the browser's own animation engine, which used to need a library.
The limits are the same as any snapshot-based approach. The animation plays between two states, so it cannot follow a drag in progress, respond to velocity, or be interrupted and redirected mid-flight the way a spring can.
What Framer Motion does that CSS cannot
Exit animations with AnimatePresence
AnimatePresence keeps a component in the DOM just long enough to play its exit animation, then removes it. It works for any state change, not just transitions, and needs no browser support beyond the basics.
The Multi-Select Tag Input uses this pattern: each tag pops in when added and slides out on removal while the remaining tags close the gap.
Layout and shared layout animations
Add the layout prop and Motion animates any change in an element's size or position between renders, including changes caused by its siblings. Give two elements the same layoutId and Motion morphs one into the other, like a highlight that glides between tabs or a card that expands into a modal.
The AI Model Selector uses layoutId this way, so the selection pill glides to whichever option you pick. Doing the same in CSS means measuring elements yourself and running the FLIP technique by hand.
Gestures and springs that keep momentum
Motion's drag, pan, hover and tap gestures feed straight into spring physics. When a user flicks an element and lets go, the spring starts from the real velocity of their hand, and if they grab it again mid-animation, it continues from exactly where it is. Fixed-duration CSS curves cannot respond to that kind of input.
Source
<motion.div
drag="x"
dragConstraints={{ left:0, right:300}}
whileTap={{ scale:0.98}}
/>
The Image Comparison Slider follows the pointer with motion values, which update the element directly without re-rendering React on every frame.
Scroll animations that work in every browser
Motion's useScroll hook returns scroll progress as a motion value you can map to any style, and Motion hands the work to the browser's native ScrollTimeline when it is available. Unlike CSS scroll-driven animations, it also works in Firefox today, and you can mix scroll progress with springs or state. The Scrubbable Video Reveal uses useScroll to scrub through an image sequence frame by frame as you scroll.
Performance: is CSS faster than Framer Motion?
For the animation itself, often not by much. The browser can run animations of transform and opacity on the compositor thread, which keeps them smooth even while JavaScript is busy. CSS transitions, CSS keyframes and Motion's Web Animations API path can all use it. What breaks smoothness is animating properties that force layout, like width, height, top or margin, in any tool.
The real cost of Motion is JavaScript you ship and run. According to Motion's own documentation:
The full motion component is about 34 kB and cannot be tree-shaken smaller.
The lighter m component with LazyMotion starts just under 4.6 kB, then loads features on demand: about 15 kB for domAnimation and 25 kB for domMax, which adds layout animations and drag.
The mini useAnimate hook is about 2.3 kB.
CSS adds nothing, because the browser already parses your stylesheet. So if you are animating dozens of decorative elements on a marketing page, CSS is the cheaper choice. If you are animating a handful of interactive components, Motion's cost is rarely what slows the page down.
Animating with Tailwind CSS
Tailwind CSS ships four ready-made animations, animate-spin, animate-ping, animate-pulse and animate-bounce, plus transition, duration-* and ease-* utilities for CSS transitions. In Tailwind v4 you can add your own animations as --animate-* theme variables next to their @keyframes, and use them as classes. For entry and exit effects on dialogs and dropdowns, the tw-animate-css package adds utilities like animate-in and fade-in, and it is the default in shadcn/ui projects.
Tailwind is still CSS underneath, so everything above applies: great for hovers, loops and simple entrances, but it cannot animate a component React has already removed or follow a drag. Many teams style with Tailwind and reach for Motion only on the components that need it, which is exactly how Wensity UI components are built.
Reduced motion and accessibility
Some people get dizzy or nauseous from large movement on screen, so operating systems let them ask for reduced motion. Every animation approach should respect it.
In CSS, use the prefers-reduced-motion media query to remove or soften movement:
Source
@media(prefers-reduced-motion: reduce){
.reveal{
animation: none;
}
}
In Tailwind, the motion-safe: and motion-reduce: variants do the same job inline. In Motion, set reducedMotion="user" on MotionConfig and Motion disables transform and layout animations for those users while keeping opacity and color changes, so the interface still gives feedback without moving around. The useReducedMotion hook returns true or false for custom logic. Reduced motion does not mean no motion: a quick fade usually remains fine.
GSAP vs Framer Motion
GSAP is the other big JavaScript animation library, with around 6 million weekly npm downloads. Since Webflow took it over, GSAP is completely free, including former paid plugins like ScrollTrigger, SplitText and MorphSVG. Commercial use is allowed. The one restriction is that you cannot use it to build a visual, no-code animation tool that competes with Webflow.
The two libraries think differently. Motion is declarative and built for React: you describe the target state in props and Motion handles enter, exit and layout changes as components re-render. GSAP is imperative and framework-agnostic: you build timelines in code and control them precisely, and in React you run it inside the useGSAP hook from @gsap/react so it cleans up after itself.
Pick Motion for product UI where animation follows state, like menus, modals, lists, tabs and drag interactions. Pick GSAP for choreographed, timeline-heavy work like long scroll-pinned storytelling sections, text splitting effects and SVG morphing, where precise sequencing matters more than reacting to state.
Other React animation libraries
Motion and GSAP cover most needs, but three other React animation libraries come up often:
React Spring animates with spring physics through hooks like useSpring, and suits developers who think in physics rather than durations.
AutoAnimate adds smooth add, remove and move animations to a list with a single hook call and almost no setup.
React Transition Group is an older, low-level tool that toggles CSS classes as components enter and leave. It is still widely installed, mostly as a dependency of older component libraries, but new projects rarely choose it directly.
If you would rather start from finished animated components than an animation library, our guide to the best React UI component libraries compares the options.
How to choose for your project
Start with CSS. Hovers, focus states, spinners, skeleton shimmers and simple fades belong in CSS or Tailwind. Nothing about them needs React to know they are happening.
Use native scroll and view transition features where support allows. A reading progress bar or a reveal on scroll is a CSS job, with an @supports check for Firefox. Page and route transitions are a good fit for the View Transitions API, through React's <ViewTransition> component if you are on React 19.3.
Bring in Motion where state and interruption matter. Toasts, modals, expanding cards, reorderable lists, tab indicators and anything users drag are where Motion earns its bundle size. Use LazyMotion and the m component to keep that cost small.
Keep the motion consistent. Match durations and easing between your CSS transitions and Motion springs so the app does not feel like it is animating in two different styles, and respect reduced motion in both.
Frequently asked questions
No. In late 2024 it became an independent project called Motion. The React version is Motion for React, installed with npm install motion and imported from motion/react. The old framer-motion package is still published and kept in step, so existing code keeps working.
Install motion for new projects and import from motion/react. Existing projects on framer-motion can keep it or switch by changing the package and updating imports from framer-motion to motion/react.
For a lot of work, yes. CSS now handles transitions, keyframes, scroll-driven animations, View Transitions and entry and exit effects with @starting-style. Motion is still the better tool for layout and shared layout animations, gestures with spring physics, interruptible motion that keeps its momentum, and exit animations driven by ordinary React state.
Both can run transform and opacity animations on the browser's compositor thread, and Motion now uses the Web Animations API where it can, so the animation itself is similar. CSS ships no extra JavaScript, while the full motion component adds about 34 kB, or under 4.6 kB to start with LazyMotion and the m component.
Not yet. As of October 2026 they work in Chrome and Edge 115 and newer and in Safari 26, but Firefox only has them in preview builds. Use an @supports check so other browsers show the finished state, or use Motion's useScroll hook for full support.
Neither is better overall. GSAP is stronger for complex timelines, scroll-pinned storytelling and SVG or text effects, and it is now free including all plugins. Motion is the better fit for React product UI where animations follow state, components enter and exit, and layouts change.
In CSS, use the prefers-reduced-motion media query or Tailwind's motion-reduce variant. In Motion, set reducedMotion="user" on MotionConfig, which turns off transform and layout animations for users who ask for reduced motion while keeping opacity and color changes.
The bottom line
CSS in 2026 can handle far more than it used to, so make it your default for any motion that does not depend on React state, and use scroll-driven animations and View Transitions where browser support allows. Reach for Motion, the library formerly called Framer Motion, the moment an animation needs to follow state, keep its momentum when interrupted, animate layout changes, or respond to a gesture. Choose per animation rather than per project, and your app stays both fast and pleasant to use.