03.02 · Page Transitions

Shared Element Transition

A picture grows from the list into the next page's header. Best for galleries.

Click it

Click a project to open it, then Back, or press Show me.

Project Name
Category
Project description goes here.

Try it

Change a setting, then try it again or press Show me.

Speed

How long the picture takes to grow into place.

Feel

Springy grows a little past the header, then settles.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add a shared element transition to [your list of items and their detail pages]. When a visitor opens an item, its picture should grow from its place in the list into the large header of the detail page, while the list fades away and the detail text fades in just after the picture lands. Measure where the picture starts and where it ends, then move a copy from one to the other with a transform only, never by changing its position or size, so it reads as one continuous element. Going back fades the detail page out and the list back in. If the visitor has reduced motion turned on, open and close the detail page without the movement. Match the settings listed below.

Replace the words in brackets with your own element. Your settings are added at the end.

Free and open source. If this helped, a star on GitHub helps other people find it.

Star on GitHub

What it is

The full explanation is in README.md.

Good for

  • Galleries
  • Product grids
  • Card lists
  • Media libraries

Avoid on

  • Unrelated pages