loading code fetching the highlighted snippet
A single layout prop turns a CSS flex flip into a smooth FLIP animation. Each direction picks its own transition — snappy spring on the way up, playful bounce on the way down.
align-items between flex-end and flex-start reflows the ball — adding layout on the motion.div turns the resulting CSS reflow into a measured FLIP animation.spring with high stiffness on the way up
gives a confident snap; a custom bounceEase on the way down lets the ball
settle playfully.MotionTransition — passing a custom
easing function (anything (t: number) => number) works just as well
as the built-in keywords.