Skip to content

Menu

View Transitions Generator

Free View Transitions generator. Build @view-transition, view-transition-name and startViewTransition code with slide, scale and fade presets.

Runs entirely in your browserFrontendFree, no sign-up
Loading tool

01What is View Transitions Generator?

View Transitions Generator writes the CSS and JavaScript you need to animate between two states of a page with the View Transitions API. You pick a transition type, a root animation, a duration, an easing and a list of named elements. The tool prints code you can paste straight into your project. There are two kinds of view transition. A same-document transition happens inside one page, for example in a single-page app. You call document.startViewTransition() with a callback that updates the DOM. The browser snapshots the old view, runs your callback, then animates to the new view. A cross-document transition happens when the user navigates between two pages. Both pages opt in with the at-rule @view-transition { navigation: auto; }, and no JavaScript is needed. MDN notes that both documents must be on the same origin. Pick "both" and you get the at-rule and the helper together. For each selector you list, the generator adds a view-transition-name rule. Elements with the same name in the old and new state animate as one shared element, so a thumbnail can grow into a hero image. Names must be valid CSS identifiers, and two rendered elements must never share a name at the same time. If they do, the ready promise rejects and the transition is skipped. The tool flags duplicate names, empty names, empty selectors, names starting with a digit, and reserved keywords such as none and auto. It also rejects durations outside 0 to 10000 ms. The root presets change ::view-transition-old(root) and ::view-transition-new(root). Crossfade keeps the browser default. Slide-left, slide-up and scale add their own @keyframes. None turns the root animation off. Duration and easing go on ::view-transition-group(*), so every group shares the same timing. An optional block switches animations off for users who set prefers-reduced-motion. Here is a worked example. With the defaults, .card-image gets the name hero-image, every group gets 300ms ease timing, and a reduced-motion block follows. You also get a small updateView() helper that falls back to a plain DOM update when startViewTransition does not exist. Switch to cross-document with slide-left at 400ms, and the output starts with the @view-transition rule, adds two slide keyframes, and drops the JavaScript entirely. The live preview runs a real same-document transition on this page when your browser supports it. Cross-document transitions cannot be previewed here, since they need two real pages. The tool does not check browser support for your users, and it does not test your selectors against your markup. Per-name animations, such as styling ::view-transition-group(hero-image) on its own, are left for you to write.

Front-end developers adding animated page and route changes to single-page apps and multi-page sites. The tool runs entirely in your browser, so your data never leaves your device.

02How to use View Transitions Generator

  1. Pick same-document, cross-document or both
  2. Choose a root animation, duration and easing
  3. List each selector and the view-transition-name it should get
  4. Fix any errors shown in red
  5. Click Run transition to preview, then copy the CSS and JavaScript

03Worked examples

Input: Defaults: same-document, crossfade, 300ms ease, .card-image named hero-image
Result: .card-image { view-transition-name: hero-image; } ::view-transition-group(*) { animation-duration: 300ms; animation-timing-function: ease; } @media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
Crossfade is the browser default, so no keyframes are added. The updateView() fallback helper is also printed (not shown).
Input: Cross-document, slide-left, 400ms, header named site-header
Result: /* Cross-document: add to BOTH pages (same origin only) */ @view-transition { navigation: auto; } ... ::view-transition-old(root) { animation: 400ms ease both vt-slide-out-left; } ::view-transition-new(root) { animation: 400ms ease both vt-slide-in-right; }
Trimmed: the header rule, group timing and keyframes sit in the middle, and a reduced-motion block follows. No JavaScript is produced in cross-document mode.
Input: .a and .b both named thumb
Result: "thumb" is used twice. Names must be unique among rendered elements or the transition is skipped.
No code is generated until the error is fixed.
Input: .x named auto, .y named 2col, duration 20000ms
Result: "auto" is a reserved keyword, not a usable view-transition-name. "2col" is not a valid CSS identifier (no spaces, cannot start with a digit). Duration must be between 0 and 10000 ms.
All problems are reported at once.
Input: Both modes, scale, 250ms cubic-bezier(0.2, 0, 0, 1), reduced motion off, .product-photo and .product-title
Result: ::view-transition-old(root) { animation: 250ms cubic-bezier(0.2, 0, 0, 1) both vt-scale-out; } ::view-transition-new(root) { animation: 250ms cubic-bezier(0.2, 0, 0, 1) both vt-scale-in; }
Trimmed to the root rules. The output also has the @view-transition rule, two name rules, scale keyframes and the updateView() helper, with no reduced-motion block.

04Common use cases

  • Adding a fade or slide between routes in a single-page app
  • Turning on cross-document transitions for a multi-page site with one at-rule
  • Morphing a list thumbnail into a detail page hero image
  • Catching duplicate view-transition-name values before they silently skip a transition
  • Spotting names like auto or 2col that browsers will not accept
  • Adding a prefers-reduced-motion fallback to existing view transitions
  • Getting a starting point for a product page where the photo and title both carry across

05Tips

  • Set a name only while it is needed and clear it afterward, since MDN warns that names left on pages kept in the back-forward cache can clash
  • For cross-document transitions, put the CSS in both pages so the effect works in both directions
  • Style ::view-transition-group(name) to change timing for old and new snapshots together
  • Always keep the fallback branch: browsers without the API should still update the DOM
  • Keep durations short, around 200 to 400ms, for route changes so navigation still feels quick

06Related concepts

View Transitions API, startViewTransition, view-transition-name, @view-transition, ::view-transition-group, prefers-reduced-motion.

Frequently Asked Questions

What is View Transitions Generator?

View Transitions Generator is a free, browser-based developer tool on AIDToolStack. Free View Transitions generator. Build @view-transition, view-transition-name and startViewTransition code with slide, scale and fade presets. It requires no installation or sign-up and works entirely in your browser.

Is View Transitions Generator free to use?

Yes. No sign-up, no fees and no usage cap.

Does View Transitions Generator store my data?

No. It runs in your browser; nothing is uploaded.

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe