Skip to main content
Back to Blog
Tutorial
Nov 20, 202415 min read2 min read

How I Add Animations Without Killing Performance

A hands-on guide to Framer Motion — the library behind every transition on this site.

Warren Richards
Authors & Developers
📚
Tutorial

Introduction

Animations bring websites to life. They guide users, provide feedback, and create memorable experiences. Framer Motion makes adding professional animations to React applications surprisingly simple.

Getting Started

First, install Framer Motion in your project:

npm install framer-motion

Basic Animations

The simplest animation uses the motion component with the animate prop:

import { motion } from 'framer-motion'

function FadeIn() { return ( Hello World ) }

Animation Properties

Framer Motion can animate virtually any CSS property:

  • opacity - Fade elements in and out
  • scale - Grow or shrink elements
  • x, y - Move elements horizontally or vertically
  • rotate - Spin elements
  • borderRadius, backgroundColor - And many more!
  • Interactive Animations

    Add hover and tap effects with the whileHover and whileTap props:

    
      Click Me
    
    

    Scroll-Based Animations

    Trigger animations when elements enter the viewport:

    
      I animate when scrolled into view
    
    

    Best Practices

  • Keep it subtle - Smooth, understated animations feel more professional
  • Mind performance - Animate transform and opacity for best performance
  • Respect motion preferences - Honor users' reduced motion settings
  • Be purposeful - Every animation should serve a purpose
  • Conclusion

    Framer Motion lowers the barrier to creating beautiful animations. Start simple, experiment, and gradually build more complex interactions as you learn.

    #web-development#react#javascript#best-practices

    About the Author

    A Tampa-based designer and developer building custom websites, e-commerce stores, and logistics platforms for businesses across the Caribbean and beyond.