Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

How to use React Framer-Motion

// INSTALL:
npm install framer-motion

// IMPORT: in your APP.js or any component file
import {motion} from framer-motion

// USE: motion gives different props like animate, initial, transition, etc..
<motion.div animate={{y:250,transition:{duration:2,delay:1} }}
initial={{x:100}}> Quantity</motion.div>
Comment

reactjs framer motion

import { motion } from 'framer-motion';

//use key with router if you are trying to do page transitions
function App ({ Component, pageProps, router}) {
	return (
   		<motion.div key={router.router} initial="pageInitial" animate="pageAnimate" variants={{
       		pageInitial: {
				opacity:0
			},
      		pageAnimate: {
           		opacity:1 
            },
		}}>
        	<Component {...pageProps} />
		</motion.div>
    )	
}

export default App;
Comment

framer motion react

<motion.div  animate={{    x: 0,    y: 0,    scale: 1,    rotate: 0,  }}/>
Comment

PREVIOUS NEXT
Code Example
Javascript :: socket.io cdn 
Javascript :: react chat sheet 
Javascript :: angular Failed to make request to https://www.gstatic.com/firebasejs/releases.json 
Javascript :: datatable table header not responsive 
Javascript :: form.reset function in javascript 
Javascript :: javascript remove object element 
Javascript :: vue computed 
Javascript :: react mui icons 
Javascript :: rect to rect collision 
Javascript :: jquery get fail 
Javascript :: moment time from now 
Javascript :: updatable time js 
Javascript :: react convert excel to json 
Javascript :: tailwincss in react native 
Javascript :: javascript spread operator 
Javascript :: populate subdocument mongoose 
Javascript :: js array split by comma 
Javascript :: reactjs navbar component 
Javascript :: ejs formatter vscode 
Javascript :: getJSON how to set async to false 
Javascript :: module export in node js 
Javascript :: thymeleaf pass variable to javascript 
Javascript :: javascript input file callback 
Javascript :: playwright headless 
Javascript :: Accessing Object Properties with Variables 
Javascript :: destructuring assignment 
Javascript :: how to add new line in jsx 
Javascript :: onclick delete self 
Javascript :: variables in js 
Javascript :: express get 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =