03.01 · Page Transitions
View Transitions API
The browser animates the change between two pages for you. Best for web apps.
Click it
Click Work or About at the top of the box, or press Show me.
Inside, a drawing of the browser's work: it pictures the old and new page, switches the page underneath at once, then moves the two pictures. Click Work or About, or press Show me.
Switches at once simply changes page; Browser animates it moves pictures of the old and new page in the style you chose. Click Work or About, or press Show me.
Try it
Change a setting, then try it again or press Show me.
Transition style
The same click, animated four different ways.
Speed
How long the change from page to page takes.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add page transitions to [your site's pages or views] with the browser's View Transitions API. Wrap each page change in a view transition: the browser takes a picture of the page before and after the change and animates between the two pictures. Name the content area so that only it animates, and turn off the default animation of the whole page. Style how the old and new pictures move with CSS, for example a fade, a slide or a zoom. Check that the browser supports the API, and simply swap the content when it does not. If the visitor has reduced motion turned on, swap the content with no animation. 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.