
Framer Motion Transition Types: The Ultimate Guide for React Developers
Framer Motion Transition Types: The Ultimate Guide for React Developers
Key Takeaways
A Framer Motion transition type determines how a value animates from its current state to a target state. There are three primary types:
tween(time-based),spring(physics-based), andinertia(momentum-based).Default Behaviors: Framer Motion intelligently defaults to
springfor physical properties (likexorscale) andtweenfor stylistic properties (likeopacityorcolor).Tailwind CSS Synergy: By combining React, Tailwind CSS, and Framer Motion, you achieve maximum developer velocity without sacrificing animation quality.
Table of Contents
- What is a Framer Motion Transition Type?
- The 3 Core Framer Motion Transition Types
- Setting a Transition in Framer Motion
- Value-Specific & Default Transitions
- Orchestration: Staggering and Delaying Transitions
- Framer Motion vs CSS Transitions in Tailwind CSS
- Frequently Asked Questions (FAQ)
If you are building modern web applications, you know that fluid animations are no longer just a "nice-to-have" — they are essential for user experience. Whether you're an indie hacker launching a new product or a SaaS owner looking to increase conversions, mastering the Framer motion transition type is your key to building interfaces that feel alive.
This article is specifically for React developers who want to move beyond basic CSS and understand exactly how to orchestrate complex, physics-based, and duration-based animations using Framer Motion alongside Tailwind CSS. Before diving in, if you want to understand how to mount and unmount components cleanly, read our guide on Framer Motion AnimatePresence.
In this comprehensive guide, we'll break down every transition type — Tween, Spring, and Inertia — along with actionable code snippets, so you can stop guessing and start building stunning animated UIs.
What is a Framer Motion Transition Type?
In Framer Motion, a transition defines how an animation occurs. While the animate prop tells a component what to animate (e.g., opacity: 1, x: 100), the transition prop determines the journey between the start and end values.
The Framer motion transition type is controlled by the type property within the transition object. By changing this single configuration, you can completely alter the "feel" of your UI.
import { motion } from "motion/react";export const Example = () => (<motion.divclassName="w-32 h-32 bg-blue-500 rounded-xl"animate={{ x: 100 }}transition={{ type: "spring", stiffness: 100 }}/>);
As cited by the official Motion documentation, if you omit the type property, Motion will dynamically choose the best transition based on the value being animated. If you are debating whether to use Framer Motion or React Spring for these effects, our Framer Motion vs React Spring comparison can help clarify the differences.
The 3 Core Framer Motion Transition Types
Framer Motion provides three distinct transition types. Let's explore each deeply.
1. Tween (Duration-Based Animations)
The tween transition type is your standard, time-based animation. It is defined by a duration and an ease (easing curve). Tween animations are predictable and excellent for stylistic changes like fading in a modal or transitioning background colors.
Key Properties:
duration: The length of the animation in seconds. The default is0.3seconds (or0.8if animating multiple keyframes).ease: The easing function. Options include names like"linear","easeIn","easeInOut", an array for a cubic bezier curve (e.g.,[0.17, 0.67, 0.83, 0.67]), or even a custom JavaScript function. Need a custom curve? Grab pre-built easing curves for Framer Motion at easing.dev.
React & Tailwind CSS Example:
import { motion } from "motion/react";export const TweenCard = () => (<motion.divclassName="p-6 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md"initial={{ opacity: 0, y: 20 }}animate={{ opacity: 1, y: 0 }}transition={{type: "tween",duration: 0.5,ease: "anticipate",}}><h5 className="mb-2 text-2xl font-bold tracking-tight text-gray-900">Tween Animation Magic</h5><p className="font-normal text-gray-700">This card fades and slides in using a deliberate, time-based tweentransition type.</p></motion.div>);
Tween Animation Magic
This card fades and slides in using a deliberate, time-based tween transition type.
2. Spring (Physics-Based Animations)
Springs are the secret behind apps that feel natural and tactile. Instead of a rigid duration, a spring animation uses physics. It calculates velocity, stiffness, and mass to arrive at the destination, creating a fluid momentum that mimics real-world interaction.
There are two ways to configure a spring in Framer Motion. Pro tip: To easily visualize and copy the exact physics properties for your UI, check out our free Framer Motion Spring Generator tool!
A. Physics-Based Configuration This uses physical properties. According to UI animation experts, these properties interact to create a highly natural feel:
stiffness(default: 100): Higher values make the movement more sudden and snappy.damping(default: 10): The opposing force. A value of 0 means the spring will bounce forever.mass(default: 1): Heavier objects move more lethargically.
B. Duration-Based Configuration This is a newer, more developer-friendly approach:
visualDuration: The time (in seconds) it visually takes to complete the bulk of the animation before the bouncy tail-end.bounce: A value between 0 (no bounce) and 1 (extremely bouncy). Default is 0.25.
React & Tailwind CSS Example:
import { motion } from "motion/react";export const SpringButton = () => (<motion.buttonclassName="px-5 py-2.5 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700"whileHover={{ scale: 1.05 }}whileTap={{ scale: 0.95 }}transition={{type: "spring",visualDuration: 0.2,bounce: 0.4,}}>Tap me for a bouncy response!</motion.button>);
3. Inertia (Deceleration Animations)
The inertia transition type takes an initial velocity and decelerates it to a stop. This is primarily used for drag interactions, such as throwing a carousel item to the left or scrolling a list. You can set constraints (min and max) so the element "bumps" or snaps to a specific boundary.
For real-world examples of drag and inertia, check out our guide on the Top 5 Framer Motion Carousels.
Key Properties:
power(default: 0.8): A higher power calculates a further target destination.timeConstant(default: 700): Adjusts the duration of the deceleration.bounceStiffnessandbounceDamping: Controls the spring physics when hitting a boundary.
React & Tailwind CSS Example:
import { motion } from "motion/react";import { useRef } from "react";export const DraggableBall = () => {const constraintsRef = useRef(null);return (<divref={constraintsRef}className="w-full h-64 bg-slate-100 rounded-xl overflow-hidden relative"><motion.divclassName="w-16 h-16 bg-rose-500 rounded-full cursor-grab active:cursor-grabbing absolute top-24 left-24 shadow-lg"dragdragConstraints={constraintsRef}dragTransition={{power: 0.2, // Inertia transition specific for draggingtimeConstant: 200,}}/></div>);};
Setting a Transition in Framer Motion
Transitions can be set at multiple levels depending on your architectural needs.
- Directly on an Animation: Add the
transitionprop next to theanimateprop on<motion.div>. - Via
MotionConfig: If you want to enforce a global animation theme across your entire React application, wrap your app in<MotionConfig>. UsingMotionConfigis especially useful when scaling animations across pages in Next.js, as detailed in our Framer Motion and Next.js guide.
import { MotionConfig, motion } from "motion/react";export const App = () => (<MotionConfig transition={{ type: "spring", bounce: 0.2 }}>{/* All motion components inside will inherit this spring transition by default */}<motion.div animate={{ x: 100 }} className="w-10 h-10 bg-black" /></MotionConfig>);
(Note: Specificity matters. A transition explicitly passed to a motion.div will override the MotionConfig defaults unless inherit: true is used).
Value-Specific & Default Transitions
What if you want a modal to slide up with a buoyant spring, but you want the background overlay to fade in with a smooth tween? You don't need two separate motion components. Framer motion transition types can be value-specific.
import { motion } from "motion/react";export const ComplexModal = ({ isOpen }) => (<motion.divclassName="fixed inset-0 bg-black/50 flex items-center justify-center"initial={{ opacity: 0, y: 50 }}animate={{ opacity: isOpen ? 1 : 0, y: isOpen ? 0 : 50 }}transition={{default: { type: "spring", bounce: 0.3, visualDuration: 0.4 }, // Applies to 'y'opacity: { type: "tween", duration: 0.2, ease: "linear" }, // Applies explicitly to 'opacity'}}><div className="bg-white p-8 rounded-2xl shadow-2xl"><h2 className="text-xl font-bold">Value-Specific Transitions</h2><p className="mt-2 text-gray-600">The opacity tweens, while the Y-axis springs.</p></div></motion.div>);
This drastically reduces the complexity of your React components and keeps your Tailwind CSS classes tightly coupled with your layout.
Orchestration: Staggering and Delaying Transitions
When rendering lists or grids (a common use case for SaaS dashboards), having everything animate at once feels overwhelming. Orchestration allows you to sequence animations using delays and staggers. To learn more about mastering staggered entrances, we cover orchestration in depth in our Framer Motion Delay tutorial.
While staggerChildren and delayChildren are traditionally used in Variants, you can also manipulate transitions using keyframes and the delay property.
import { motion } from "motion/react";const items = [1, 2, 3, 4];export const StaggeredList = () => (<ul className="space-y-3">{items.map((item, index) => (<motion.likey={item}className="w-full h-12 bg-emerald-100 rounded-md ring-1 ring-emerald-300"initial={{ x: -400 }}animate={{ x: 0 }}transition={{type: "spring",delay: index * 0.1, // Staggers the entrance based on array index}}/>))}</ul>);
- Staggered Item 1
- Staggered Item 2
- Staggered Item 3
- Staggered Item 4
You can also use these transitions in tandem with scrolling effects. For implementing scroll-based appearances, check out how to do React Scroll Animation in Framer Motion.
Framer Motion vs CSS Transitions in Tailwind CSS
You might ask: "Why use a Framer motion transition type when Tailwind CSS has transition utilities like transition-all duration-300 ease-out?"
While Tailwind CSS is incredible for simple hover states (hover:bg-blue-600), CSS transitions fall short in several areas:
- Unmount Animations: CSS cannot natively animate an element as it is removed from the DOM. Framer Motion handles this elegantly with
AnimatePresenceand theexitprop. - True Springs: CSS only supports cubic-bezier curves. It cannot calculate physics like mass and velocity. Real spring physics require Javascript, which Framer Motion provides out-of-the-box.
- Complex Choreography: Sequencing complex animations across DOM trees is nearly impossible in pure CSS without spaghetti code.
Rule of Thumb: Use Tailwind CSS for simple color or shadow on-hover changes. Use Framer Motion for layout changes, entrance/exit animations, and complex interactive springs.
Frequently Asked Questions (FAQ)
What is the default transition type in Framer Motion?
Framer Motion defaults to a dynamic approach. Physical properties like x, y, scale, and rotate default to a spring animation. Stylistic properties like opacity, color, and backgroundColor default to a tween animation.
Can I use a custom easing function for a tween transition?
Yes. You can provide an array of four numbers representing a cubic bezier curve (e.g., [0.17, 0.67, 0.83, 0.67]) or pass a custom JavaScript easing function that takes a progressive value from 0 to 1 and returns a modified value.
Why does my spring animation ignore the duration prop?
If you explicitly set physics-based properties like stiffness, damping, or mass, they will naturally override any duration or bounce settings. To use duration on a spring, rely exclusively on visualDuration and bounce but try to avoid these properties as much as you can.
How do I disable animations globally for users who prefer reduced motion?
Framer Motion respects prefers-reduced-motion settings natively if you use the useReducedMotion hook. You can conditionally render less intense transitions or bypass the animation entirely to respect accessibility.
Conclusion: Elevate Your React App
Understanding the Framer motion transition type fundamentally changes how you approach UI development. By choosing the right mix of tween for fades, spring for mechanical interactions, and inertia for draggable areas, you elevate a standard React app into a premium, tactile experience.
Pairing these smooth transitions with the rapid styling of Tailwind CSS makes for an unmatched developer experience. But writing these complex, hyper-polished components from scratch takes hundreds of hours of trial and error.
If you are looking to build custom interactive sections quickly, try out our free Framer Motion Component Generator before modifying the code by hand.
Stop wasting time reinventing the wheel.
If you are a developer, an indie hacker, or a SaaS owner who wants to deploy beautiful, high-converting interfaces in minutes instead of weeks, you need ogBlocks.
Explore the ogBlocks Component Library today and get instant access to hundreds of React and Tailwind CSS components, fully armed with the exact optimized Framer Motion transitions discussed in this guide. Don't let clunky UI cost you customers — upgrade to ogBlocks and ship faster.
Written by Karan
ogBlocks is an Animated React UI Component library built with Motion and Tailwind CSS