03.04 · Page Transitions

Crossfade Transition

The old page fades out as the new one fades in. Best for calm page changes.

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.

Fade order

Together, both pages show at half strength midway.

Speed

How long the whole fade takes.

More optionsFewer options

Feel

Even keeps one steady pace, the plainest fade.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add a crossfade between [the pages or views you want to switch between]. Stack the old and the new page in exactly the same place, then fade the old one out and the new one in. When the two fades run together, both pages are half visible for a moment and blend; one after the other, a short blank moment falls between them. Nothing moves; only how see-through each page is changes. It is the calmest page change and suits content that has no order. If the visitor has reduced motion turned on, switch pages instantly. 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

  • Tabs
  • Image galleries
  • Content swaps
  • Calm sites

Avoid on

  • Step-by-step flows