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.

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.

More optionsFewer options

Feel

Gentle eases in and out; Even keeps one steady pace.

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.

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 GitHub

What it is

The full explanation is in README.md.

Good for

  • Web apps
  • Page changes
  • Tabs and filters
  • Galleries

Avoid on

  • Frequent updates