Expandable Card On Click
Cards display in a two-column grid with image, title, and description. Clicking a card triggers a shared element transition where the image, title, and description animate smoothly to their expanded positions. The layoutId prop connects corresponding elements between collapsed and expanded states.
The expanded card renders in a fixed overlay with a semi-transparent black backdrop. Additional content appears with a fade-in animation after the layout transition completes. Clicking outside the card or pressing Escape closes the modal using the useOutsideClick hook and keyboard event listener.
The backdrop uses AnimatePresence for enter/exit animations. Cards have consistent shadow styling and responsive sizing with the expanded modal capped at max-w-sm.
Works well for product catalogs, car dealership sites, real estate listings, and any gallery where users need to see more detail without leaving the page.
Part of Cards ยท All blocks
Build websites faster and 10x better than your competitors with
Aceternity UI Pro
Next.js 15, Tailwind CSS v4 and Motion for react powered templates
100+ templates and blocks combined
Ready to copy paste component blocks, save days of development time







