Vibary.ai
← Vibe Coding

Expandable Detail Card

A compact card that expands in place into a detail view — image and title travel continuously.

navigationpremiumelegantinteraction · finite · intermediate · ~0.5s
Interactive · click to play
Variant

The animated component in this preview is rendered from the canonical file shown here. The surrounding demo shell only provides context and is not part of the copied code.

238 lines · react + motion only
import { useState } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";

/**
 * Vibary · Expandable Detail Card
 *
 * A compact card that expands in place into a detail view. The
 * thumbnail and title are shared elements: Motion's layout animation

About this pattern

List-to-detail without a page change. Tapping the compact card grows it in place: the thumbnail and title keep their identity while the layout reflows around them, and the detail content fades in once the surfaces have settled. Continuity is the point — the user never loses track of what they tapped, which makes this the pattern of choice for galleries, product lists and profile cards.

List → detailProduct cardArticle previewProfile card

Where it shows up

Screens we drew to show where this motion usually sits. Illustrations, not captures of any product.

  • Photo gallery

    The canonical card-to-page expansion: artwork and title stay continuous.

Related patterns