Skip to content

Instantly share code, notes, and snippets.

@alexcarpenter
Created April 1, 2022 13:38
Show Gist options
  • Save alexcarpenter/c1458ec432ab259bdc453e389b08c54d to your computer and use it in GitHub Desktop.
Save alexcarpenter/c1458ec432ab259bdc453e389b08c54d to your computer and use it in GitHub Desktop.
const container = {
hidden: { opacity: 0 },
show: {
opacity: 1,
transition: {
staggerChildren: 0.25,
},
},
}
const item = {
hidden: { opacity: 0, y: 75 },
show: {
opacity: 1,
y: 0,
},
}
<motion.section
variants={container}
initial="hidden"
whileInView="show"
viewport={{ once: true, amount: 0.5 }}
>
<motion.div variants={item}>....</motion.div>
<motion.div variants={item}>....</motion.div>
<motion.div variants={item}>....</motion.div>
</motion.section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment