Bag of Tricks for View Transitions @vtbag.dev ยท Apr 23

Love those classic thumbnail detail zooms with shared images in cross document view transitions? Want the same trick when switching state on the same page? Just give the thumbnail and the large image the same view-transition-name ๐Ÿ˜ฒ ๐Ÿšจ๐Ÿšจ !Non-unique view transition name panic! ๐Ÿšจ๐Ÿšจ ๐Ÿ‘‡ See next post ๐Ÿ‘‡

0 likes 1 replies

?

Replies

Bag of Tricks for View Transitions ยท Apr 23

We all learned that view transition names must be unique on a page. Sure. Just hide all but one occurrence with CSS and you are set. No JavaScript needed for dynamic view transition name assignment. Here is how you can hide static view transition names from the View Transition API: