Skip to content
Home Tutorials Roadmaps Courses
Log in Join free
Tutorials React Framer Motion
React Intermediate FREE

Framer Motion

Lesson 1 of 17 Intermediate Interactive

Framer Motion is a production-ready animation library for React with a simple API.

Syntax

REACT
import { motion } from "framer-motion";

function Box() {
    return (
        <motion.div
            initial={{ opacity: 0, y: -50 }}
            animate={{ opacity: 1, y: 0 }}
            transition={{ duration: 0.5 }}
        />
    );
}
Framer Motion Animation
REACT
import { motion } from "framer-motion";

function Box() {
    return (
        <motion.div
            initial={{ opacity: 0, y: -50 }}
            animate={{ opacity: 1, y: 0 }}
            transition={{ duration: 0.5 }}
            style={{
                width: 100, height: 100,
                background: "blue", borderRadius: 8
            }}
        />
    );
}