Back to all posts

Add Delightful UX with Motion/react

Sprinkle some animation magic into your React apps using Motion/react

Motion/react, Animation, React, UI/UX

Add Delightful UX with Motion/react

Sprinkle some animation magic into your React apps using Motion/react

Motion/reactAnimationReactUI/UX

Animations don’t just look good—they communicate state changes, guide the user, and make your app feel alive.

That’s where Motion/react shines. It’s the animation library I reach for whenever I want micro-interactions or buttery transitions without wrestling with keyframes.

Install It

npm install motion/react
pnpm add motion/react
yarn add motion/react
bun add motion/react

Fade In on Mount

1import { motion } from "motion/react";2
3export function FadeIn({ children }) {4  return (5    <motion.div6      initial={{ opacity: 0, y: 10 }}7      animate={{ opacity: 1, y: 0 }}8      transition={{ duration: 0.4 }}9    >10      {children}11    </motion.div>12  );13}

Use it like:

1<FadeIn>2  <h2>Welcome to my blog 🚀</h2>3</FadeIn>

Animate Page Transitions

1import { AnimatePresence, motion } from "motion/react";2
3export function PageWrapper({ children, key }) {4  return (5    <AnimatePresence mode="wait">6      <motion.div7        key={key}8        initial={{ opacity: 0, scale: 0.95 }}9        animate={{ opacity: 1, scale: 1 }}10        exit={{ opacity: 0, scale: 0.95 }}11        transition={{ duration: 0.3 }}12      >13        {children}14      </motion.div>15    </AnimatePresence>16  );17}

Hover Interactions

1<motion.button2  whileHover={{ scale: 1.05 }}3  whileTap={{ scale: 0.95 }}4  className="rounded bg-black px-4 py-2 text-white"5>6  Hover me7</motion.button>

Conclusion

Motion(previously Framer Motion) lets you craft smooth, intentional animations without diving deep into CSS or GSAP. Use it for loading states, cards, modals, page transitions—or literally anything interactive.

A little motion goes a long way toward a polished UX. Trust me—your users will feel the difference.

check out the Motion website for more information.

Resources