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.
Inside, the dashed boxes are where the picture starts and ends: one copy of it grows along the lines between them while the pages fade. Click a project, or press Show me.
Just fades swaps the list for the project with fades only; Picture travels does the same while the picture grows from the list into the header. Click a project, then Back, or press Show me.
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.
Your settings
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 GitHubWhat it is
The full explanation is in README.md.