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

framer motion reactjs

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 :: javascript round .5 down 
Javascript :: remove trailing zeros javascript 
Javascript :: window scroll up 
Javascript :: convert string to lowercase javascript 
Javascript :: angular http get status code 
Javascript :: javascript map array 
Javascript :: tostring js 
Javascript :: vue js hooks 
Javascript :: ANGULAR locale fr 
Javascript :: javascript list to object map 
Javascript :: jquery timer countdown 
Javascript :: react native flatlist container style 
Javascript :: (error) = { console.log(error); } 
Javascript :: toLocalString 
Javascript :: what difference between react func and class components 
Javascript :: text background fabricjs 
Javascript :: jquery.mask.js 
Javascript :: array javascript 
Javascript :: how to add element in json object 
Javascript :: Get width of screen on resize event 
Javascript :: group by in javascript 
Javascript :: entypo icons react native 
Javascript :: react native webview disable touch 
Javascript :: javascript pure ajax 
Javascript :: User Input from Javascript Console 
Javascript :: foeach in js 
Javascript :: jquery not equal 
Javascript :: load url onclick javascript 
Javascript :: stack in javascript 
Javascript :: useEffect : react 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =