sveltejs / examples

A collection of Svelte(Kit) examples
MIT License
35 stars 5 forks source link

Page Transitions Example #9

Open evanwinter opened 1 year ago

evanwinter commented 1 year ago

SvelteKit makes it really easy to do page transitions with svelte/transition. It would be cool to have a go-to example for this. This is how I've been doing it, but would love to know if there's a better way:

https://user-images.githubusercontent.com/19195468/226080657-d5b9df9f-fe93-4d4a-8762-b88b6d563222.mov


karimfromjordan commented 1 year ago

Yeah, this is pretty much how it's done in Svelte with most routers including Sapper and SvelteKit. Routers like Tinro also mention this approach in their READMEs. Something else I've been thinking about for the future is an example for page transitions using the new View Transition API. A few people have already been playing around with it. But that might be better as a separate example until all browsers support the API.