vibran

Expanding card

Also called: shared element transition

On click, the card grows from its own spot until it fills the whole area and reveals the full content. It closes with the X or Esc and shrinks back to exactly where it came from.

Preview of Expanding card running live
Copy the promptAdjust colors and speed

When to use it

Good for menus, projects, listings, courses and recipes: the grid shows the summary and the open card shows the full sheet, without changing pages. The container needs a defined height, since the open card fills its area. Mark what shows only when open with data-detalhe and what shows only when closed with data-resumo.

How to add it to your site

  1. Copy the prompt in the gallery. It comes with the effect's name and the full code. The prompt text is written in Portuguese, and AI builders handle that fine.
  2. Paste it into your AI: Lovable, Claude, Cursor, Bolt or v0.
  3. Done: the AI adds the effect to your project, just like you saw it here.

Use it in HTML

The effect is plain JavaScript, no library. Just put the data-efeito attribute on the element:

<div data-efeito="cartao-expandir" style="display:grid;grid-template-columns:repeat(3,1fr);gap:16px;height:420px"><article><h3>Título</h3><div data-detalhe>Conteúdo que só aparece aberto</div></article>...</div>

More cards effects

All 27 cards effects →