Socket
Socket
Sign inDemoInstall

framer-motion

Package Overview
Dependencies
8
Maintainers
37
Versions
1043
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    framer-motion

A simple and powerful JavaScript animation library


Version published
Maintainers
37
Install size
2.32 MB
Created

Package description

What is framer-motion?

The framer-motion npm package is a popular library for creating animations and transitions in React applications. It provides a powerful and easy-to-use set of tools for animating components, handling gestures, and creating complex motion effects with simple declarative syntax.

What are framer-motion's main functionalities?

Basic Animations

Animate the horizontal position of a component to 100 pixels.

{"<motion.div animate={{ x: 100 }} />"}

Variants

Use variants to define animation states and transition between them.

{"<motion.div variants={variants} initial='hidden' animate='visible' />"}

Gestures

Scale a button up on hover and down on tap.

{"<motion.button whileHover={{ scale: 1.1 }} whileTap={{ scale: 0.9 }} />"}

Drag

Make a component draggable.

{"<motion.div drag />"}

Shared Layout Animations

Animate layout changes between components that share a layoutId.

{"<motion.ul layout><motion.li layoutId='id' /></motion.ul>"}

Exit Animations

Animate the component out when it's removed from the React tree.

{"<motion.div exit={{ opacity: 0 }} />"}

Other packages similar to framer-motion

Changelog

Source

[11.0.3] 2024-01-24

Fixed

  • Fixed layout animation bug in Framer.

Readme

Source

Framer Motion Icon

Framer Motion

An open source motion library for React, made by Framer.

Motion powers Framer, the web builder for creative pros. Design and ship your dream site. Zero code, maximum speed.


Start for free


Framer Banner


Chat on Discord




Framer Motion is an open source, production-ready library that’s designed for all creative developers.

It looks like this:

<motion.div animate={{ x: 0 }} />

It does all this:

...and a whole lot more.

Get started

πŸ‡ Quick start

Install framer-motion with via your package manager:

npm install framer-motion

Then import the motion component:

import { motion } from "framer-motion"

export const MyComponent = ({ isVisible }) => (
    <motion.div animate={{ opacity: isVisible ? 1 : 0 }} />
)

πŸ“š Docs

πŸ’Ž Contribute

πŸ‘©πŸ»β€βš–οΈ License

  • Framer Motion is MIT licensed.

✨ Framer

Keywords

FAQs

Last updated on 24 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc