Loading effect…
Loading preview…
interactions · react · free
A stack of gradient cards glides into the corner with a staggered layout animation and flies back on click.
npx znverse add motion-layout-cardsInstalls motion.
"use client";
import { motion, stagger } from "motion/react";
import { useEffect, useState } from "react";
type CardProps = {
bg: string;
index: number;
total: number;
extraStyle: { y: number; scale: number; zIndex: number };
stackMaxY: number;
};
const EDGE = 16;
const CORNER_POSITION = {
bottom: `${EDGE}px`,
right: `${EDGE}px`,
width: "100px",
height: "100px",A stack of gradient cards glides into the corner with a staggered layout animation and flies back on click.
Copy src/ into a React project and render <MotionLayoutCards />.
Originally published at https://github.com/Hank-D-Tank/motion-layout-1.