Skip to content

Page Transitions

Transitions between views and states.

1 component

View Transitions API Page Transition – Pure CSS page transitions preview

View Transitions API Page Transition

Playlist grid and detail views that cross-fade with the native View Transitions API, morphing the cover art between views, with an instant fallback.

What are page transitions?

Page transitions are animations that play when the user moves between views or states: a fade or slide between pages, a shared element morphing from a card into a detail view, tab panels sliding in, loading overlays and wipe effects. They help users understand where they came from and where they are going, in single-page apps as well as classic multi-page sites.

When to use view transitions

Use a transition when it clarifies a change in context, such as opening a detail view from a list or stepping through a wizard. Keep them short so they never slow down navigation. If a transition only adds delay, leave it out.

Best practices for smooth page transitions:

  • Use the View Transitions API (document.startViewTransition() and, for multi-page sites, the @view-transition rule) where supported, with a plain instant change as the fallback.
  • Keep durations around 200 to 400 milliseconds and use easing that feels natural.
  • Animate transform and opacity to stay on the GPU and avoid layout thrashing.
  • After a transition, move focus to the new main heading or content and update the document title so screen reader users know the view changed.
  • Respect prefers-reduced-motion with a simple crossfade or no animation at all.
  • Never block interaction while waiting for an animation to finish.
  • Test on slow devices; long overlays can make a fast site feel slow.

Bootstrap, Tailwind CSS and pure CSS transitions

Each page transition comes with a live preview and code tabs for HTML, CSS and JS. Bootstrap 6 versions use the new alpha ES module build and theme-* colour roles, Bootstrap 5 versions animate standard layout pieces, Tailwind CSS versions use transition and animation utilities, and pure CSS versions rely on keyframes and the View Transitions API. Use the framework filter, copy or download the code and connect it to your router or links.