Pinned
Hi friends! Just moved to our new home at vtbag.dev! Follow The Bag to catch the next cool tricks weβll pull out!
Bag of Tricks for View Transitions
@vtbag.dev
The π Bag of Tricks β¨ for View Transitions | https://vtbag.dev The π Bag of Tricks β¨ for Astro's View Transitions | https://events-3bg.pages.dev Tools, Info, Tips & Tricks Enhance Your Development Skills with the View Transition API
188 followers1 following387 posts
Pinned
Hi friends! Just moved to our new home at vtbag.dev! Follow The Bag to catch the next cool tricks weβll pull out!
Bag of Tricks for View Transitions reposted
Built an entirely reasonable dark mode toggle for ChaTodo: pull the cord, the bulb swings, the lighting changes, and View Transition handles the rest. Was all that necessary? Of claws. Iβm no kitten when it comes to design. πΌ Pull it yourself: chatodo.app #DarkMode #WebDesign #Cat
Bag of Tricks for View Transitions reposted
Auf der #unkonf in Mannheim bin ich noch als LΓΌckenfΓΌller eingesprungen und habe 20 Minuten ΓΌber view-transitions gesprochen. Das wΓ€re die lΓ€ngere Version gewesen: grochtdreis.de/talks/unkonf... #unkonf26 #css #viewtransitions
Bag of Tricks for View Transitions reposted
Remember Internet Explorerβs βPage Transitionsβ? Well, theyβre back, thanks to the View Transition API! β Blog post: brm.us/page-transit... β Demo site: page-transitions.style The project leverages IEβs meta tags so browser support is not limited to Modern Browsersβ’ but also includes IE 5.5β8.0 π
It might take a while until @navigate becomes baseline. In the meanwhile, you can use the turn-signal scripts to get forward/backward view transition types for history traversals automatically. And much more, like setting types per link or getting directions based on the order of your pages.
Bag of Tricks for View Transitions reposted
This is huge for MPAs. Once these features are Baseline, theyβll make a hell of a difference. The initial proposal is open for feedback, so donβt miss your chance to influence where it goes next.
One of the things that we at Chrome have been thinking about is a way to do declarative route and navigation matching **in CSS**. Together with @nomster.bsky.social and @dbaron.org Iβve been working on it for the past few months, and next week weβll be presenting our work at the CSSWG F2F meeting.
Great insights on making View Transitions enhance, rather than overshadow, your UI. I cannot help feeling this was written with people like me in mind. π
2. Tips for good performance: - Keep animations short (0.2 to 0.5 seconds). - Only animate simple things like opacity or transform. - Avoid animating large, heavy images. - This keeps your website fast on all devices. 3/4
Bag of Tricks for View Transitions reposted
agh, stumbled into an issue I didn't realise before now: web view transitions aren't hardware accelerated if the size of the element changes. Great writeup by @bram.us here: www.bram.us/2025/02/07/v...
An engaging behind-the-scenes look at how it all came together. Seeing the design decisions, experiments, and the little problems that needed solving is what makes these write-ups so valuable. Lots of first-hand insights and practical tips in here.
I didn't get to all the cool view transition stuff I added to the JS heroes conference demo I made for my talk, so here it is in one blog post! cydstumpel.nl/a-deep-dive-...
It is even more dynamic: the ::view-transition-new pseudo is not a screenshot but displays the image _while_ it is loading. You could avoid a broken appearance by pausing the view transition animations right at the start, while only the old image is visible, and waiting for the new image to load...
Turns out optimizing for performance can actually harm user experience⦠Did you know that decoding="async" can break multipage View Transitions? #CSS #HTML #UX #WebDev
Bag of Tricks for View Transitions reposted
I wrote a small article explaining how to animate the <dialog> element using the View Transition API. The article also goes into Invoker Commands API and it concludes with some handy tips and tricks that improve the default behaviour of the <dialog> modal. pqina.nl/blog/animati...
Dialog view transitions with invoker commands. 1. Intercept the "command" and "cancel" events. 2. Run startViewTransition(), in the callback move the view-transition-name from the <button> to <dialog> (and back). 3. Then call `showModal()` or `close()` to toggle the dialog.
Bramus has a new post on when match-element is the right tool for the job, and, just as important, when it isnβt! Looking for a wider view? Visit vtbag.dev for a discussion and comparison of alternative approaches. vtbag.dev/tips/auto-na...
New Blog Post: View Transitions: Should you use the new `attr()` or `match-element` for the `view-transition-name`? Well β¦ It Dependsβ’ www.bram.us/2026/06/19/v...
Bag of Tricks for View Transitions reposted
This was so helpful to me. Cyd is the VT GOAT. I now get that `::view-transition-group` is what you target to fiddle with the *size and movement* during the transition. And the -old and -new ones are the individual elements and what you need to deal with for funky aspect ratios and whatnot.
When @chriscoyier.net asks you to write an article, you say yes! π master.dev/blog/demysti...
A very good intro that avoids the usual pitfalls. What I especially like is that David understands, and conveys, how CSS property inheritance works with the pseudo-elements: animation-duration lives on the group, while animation-name is not set via the shorthand, which would reset other properties.
Cross-document view transitions bring app-like page transitions to any classic website, one CSS rule, no JavaScript. www.rotecodefraktion.de/en/blog/css-... #CSS #Frontend #HTML #WebDevelopment
Havenβt read it yet? Pop over and have a look!
Not to toot my own trumpet too much, but I think this is an extremely solid resource for understanding view transitions. I've no shame in admitting that I've returned to reference this post when working with view transitions and all the borderline magic you can do with them.
"enables geometry-aware view transitions.It also allows you to intercept a view transition mid-flight to start a new one, utilizing the coordinates of the currently animating element to avoid sudden visual jumps."
Blink: Intent to Ship: CSSPseudoElement support for ::backdrop, ::scroll-marker and ::view-transitions
Part 2 from Durgesh, with detailed insights and plenty of personal experience. css-tricks.com/cross-docume...
Bag of Tricks for View Transitions reposted
Haha, repeatedly spelling out in a CSS-Tricks article, complete with code examples, which outdated syntax no longer works is definitely going to get baked into the brains of every LLM out there. π«‘
Lots of moving parts with cross-doc view transitions, and plenty that can go wrong. I struggle with them for sure but this post has helped a lot. css-tricks.com/cross-docume... And a second part coming next week!
Bag of Tricks for View Transitions reposted
As an alternative to mapping routes and matching paths, you can define the view transition type directly where it happens: on the link. I adapted the Chrome DevRel demo to use @vtbag/turn-signal/link-types π¨βπ§ Same result, just a different way of thinking about it. vtbag.dev/navigation-t...
Here's that directional View Transitions demo we talked about over lunch, @twnsnd.com chrome.dev/view-transit... The toolkit automatically injects from-<name> and to-<name> View Transition Types based on navigation origin and destination. The routes are defined in a routemap.
Cool use case for view transitions from @chriscoyier.net
Animating Focus with View Transitions Let's try a fresh take on animating focus rings around a page. Flying focus, as it were. Only instead of measuring where elements are ourselves, we'll let View Transitions figure it out.
The View Transition API is getting more forgiving: in future, duplicate view transition names will no longer cancel your animation. The API will sweep them aside, give you a nudge in the console, and carry on with the uniquely named elements. Catch all the recent changes on The Bagβs API page:
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 π
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:
Bag of Tricks for View Transitions reposted
Really nice use of the View Transition API!
Want to realize you've been storing your celery wrong your whole life? check out howtostore.food π₯¦π₯π Idea has been kicking around in my head for 10+ years, finally made feasible by AI. Still more to do, but very proud of the native view transitions! (built on @astro.build and @cloudflare.social)
:active-view-transition-type() is a lifesaver when you want to isolate different view transition use cases on the same page. Here is how: vtbag.dev/tips/css/#sc...
The :active-view-transition and :active-view-transition-type() pseudo-classes are now Baseline Newly available β goo.gle/4qtrKgu Use these to apply specific style rules while transitions are in flight.
Bag of Tricks for View Transitions reposted
So, Iβve written a bunch of things on how to do certain things with View Transitions, such as optimizing the keyframes or driving a VT by scroll. I noticed I repeat a lot of code throughout those experiments β¦ so I bundled that all up in a package for you. π chrome.dev/view-transit...
Cool view transition demo by @paolo.ricciuti.me !
Modern CSS is just so awesome...all of this with view transitions! svelte.dev/playground/e...
Astro v6 just landed, and you can view transition of astro-vtbot from Astro v5 to v6 as a smooth move, simply by letting a version update slide into place. The new astro vtbot v2.1.12 is ready and works with both Astro v5 and v6. π www.npmjs.com/package/astr...
ππππ -ππππππππππ-πππππ: ππππ β πππ πΊπππ πππππ πππππ, πππ ππππ vtbag.dev/basics/javas...
View Transition API: There is a new kid on the block! π Meet the new `view-transition-scope` property and discover how it helps you avoid name clashes with scoped view transitions. It gives you a clean way to manage transition names and keeps nested transitions from stepping on each other.
Think same document view transitions are supported everywhere? Think again. Some older browser versions only support the Level 1 API, or not even that. Bramus's library lets you code against the Level 2 API regardless of native support,... ...much like the Bag's mayStartViewTransition():
Introducing `view-transitions-mock`: A non-visual Polyfill for Same-Document View Transitions brm.us/view-transit... It is a spec-compliant JavaScript implementation of Same-Document View Transitions that polyfills the entire JavaScript API surface but that doesnβt do the animation bits.
If you like Adam's article, you might also want to have a look at vtbag.dev/vector-demo/ and fun-with-view-transitions.pages.dev/episode/7/page
how to make #CSS view transitions swoop or have motion blur or how I learned to help view transitions not always go in straight lines β€· nerdy.dev/swoop-there-...
Surely thereβs something we can do. π
the html5 view transitions api is cool, but, it preventing interactions on the page while it animates is kinda nott greatt
Bag of Tricks for View Transitions reposted
Playing around with scoped view transitions on @codepen.io codepen.io/g12n/pen/RNR...
Bag of Tricks for View Transitions reposted
Blink: Intent to Ship: Element-scoped view transitions
Bag of Tricks for View Transitions reposted
Replying to @stuffbreaker.bsky.social
If you want, you can delay the start of cross-document view transitions by blocking the renderer until the custom elements are defined. Then the last frame you see is the previous page. After the renderer resumes, the next frame shows the loading page with defined custom elements.
Bag of Tricks for View Transitions reposted