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 :: javascript insertbefore 
Javascript :: javascript node-schedule 
Javascript :: javascript ascii character a to z 
Javascript :: mongodb text search exact match 
Javascript :: angularjs format number thousands separator 
Javascript :: mui react outlined input helperText 
Javascript :: javascript list class properties 
Javascript :: upload file on node js azure function 
Javascript :: js get datatable attr value on click 
Javascript :: react particles react 
Javascript :: axios npm 
Javascript :: regex match any character 
Javascript :: disable zoom in app 
Javascript :: compare strings js 
Javascript :: decimal to base 32 javascript 
Javascript :: function declaration and function definition in javascript 
Javascript :: javascript get cpu cores 
Javascript :: send data using fetch 
Javascript :: $.get jquery return value 
Javascript :: jquery datatable draw false 
Javascript :: overflowx javascript 
Javascript :: mysql json 
Javascript :: node.js 8 has been deprecated. firebase functions 
Javascript :: javascript unique array 
Javascript :: multi dimensional array javascript 
Javascript :: Modal Dialogs in React 
Javascript :: javascript training 
Javascript :: angular injectiontoken 
Javascript :: how can you set an environment variable in node 
Javascript :: js delete all cookies 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =