April 9, 2026IntermediateGalleries & Media
Layout Grid Flip
A card grid that animates between large (3-col) and small (5-col) layouts using GSAP Flip. Cards reflow with a smooth positional tween and the container height animates in sync. Subtitle text fades out in small view. Respects prefers-reduced-motion.
Preview
Source
import LayoutGridFlip, { LayoutGridCard } from "./index.jsx";
import { layoutGridFlip } from "../demo-data.js";
import styles from "./demo.module.css";
export default function LayoutGridFlipDemo() {
return (
<div className={styles.demo}>
<h2 className={styles.heading}>Selected Work</h2>
<LayoutGridFlip defaultLayout={layoutGridFlip.defaultLayout}>
{layoutGridFlip.cards.map((card, i) => (
<LayoutGridCard key={i} {...card} />
))}
</LayoutGridFlip>
</div>
);
}
Dependencies
gsap