View Transition

You might say

Clicking a card to open its detail page flashes abruptly—can the cover image smoothly expand into the detail header?

A native browser mechanism that snapshots the old and new views and smoothly transitions between them, including morphing shared elements.When clicking a gallery card replaces the DOM with a detail page, plain CSS transitions break across unmounted nodes. The View Transitions API (document.startViewTransition + view-transition-name) snapshots both states and smoothly morphs matched elements into place. Every active view-transition-name must be unique on screen, and browsers without support must still navigate directly.
View TransitionsView Transitions APIstartViewTransition

You can say this to an AI Agent

Ready to paste into Cursor, Claude Code, or Codex
Structured AI Agent prompt

Add a shared-cover transition from the gallery list to the detail view using the View Transitions API (`document.startViewTransition`): pair a unique `view-transition-name` between the clicked card cover and the detail header image so duplicate names never abort the transition. Fall back cleanly to an immediate update in browsers without `startViewTransition`, and shorten or disable motion under prefers-reduced-motion. Verify forward navigation, back navigation, and fallback behavior.

Want your Agent to translate plain-language UI ideas automatically?Install free VibeHub Skill →
Oil UI Pro. Push AI’s design skills to the limit. Usability, existing projects and stricter review.
Further reading