
✍️ By Shoaib — A Full-Stack Developer Sharing What Actually Works
Let’s be honest: I used to think animations were “fluff.”
But after working on multiple production projects, I’ve realized micro-interactions and intentional motion can:
But only when done right.
That’s where Framer Motion comes in.
Framer Motion is a production-ready animation library for React.
It gives you simple primitives like motion.div, variants, and animatePresence — all built with performance and accessibility in mind.
It’s built on the Popmotion engine but feels very “React” to use.
Here’s how I’ve personally used Framer Motion across different projects:
I used AnimatePresence with motion.div for smooth transitions between routes — especially in my portfolio and landing pages.
import { motion, AnimatePresence } from "framer-motion";
<AnimatePresence mode="wait">
<motion.div
key={route}
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
transition={{ duration: 0.3 }} >
<YourComponent />
</motion.div>
</AnimatePresence> These 300ms transitions soften the experience without overloading the UI.
Buttons are where users interact the most — yet most devs leave them static.
I use scale on tap to add tactile feedback:
<motion.button
whileTap={{ scale: 0.95 }}
whileHover={{ scale: 1.05 }}
className="btn-primary" /> It’s subtle, but it makes the experience feel way more responsive.
With whileInView and viewport props, Framer Motion handles scroll-based entrance animations without any extra dependency.
<motion.div
initial={{ opacity: 0, y: 50 }}
whileInView={{ opacity: 1, y: 0 }}
transition={{ duration: 0.4 }}
viewport={{ once: true }} >
<YourSection />
</motion.div> Way smoother than handling scroll listeners manually.
A common myth: "Animations hurt performance."
Yes, they can — if done poorly.
Here’s how I avoid that:
viewport={{ once: true }})transform, not top or left)You don’t want animations to make your site feel dizzy.
Here's what I check:
prefers-reduced-motion)You can access user preferences easily:
const shouldReduceMotion = useReducedMotion(); Not every component needs motion. I usually avoid animations on:
Remember: motion should serve UX, not just aesthetics.
What I’m seeing now (and building toward):
I never thought I’d be that guy tweaking animation curves — but once I saw the difference it made in how users feel your product, I couldn’t unsee it.
And honestly?
It made me enjoy building UIs way more.
Framer Motion isn’t just “nice to have” — it’s becoming a standard for modern UI development.
If you're a React or Next.js developer, I highly recommend learning it with intention, not just copying code.
It’s the difference between “working UI” and memorable UI.