View Transition Generator
Animate between page states the modern way. Pick an effect, preview it live, copy the code.
The toggle swaps the preview between grid and list using document.startViewTransition, animated by the exact CSS this page generates for you.
Your Code
Page transitions without the animation plumbing
Native-feeling motion used to be the web's missing piece: apps glided between screens while websites jumped. The View Transitions API closes that gap with a snapshot trick. The browser photographs the current state, you change the DOM however you like, and it animates between the two photographs using ordinary CSS animations attached to ::view-transition-old and ::view-transition-new. Because you style pseudo-elements instead of orchestrating elements, one snippet restyles every state change on the page.
This generator produces the two halves you need: the effect CSS for the root transition, and the startViewTransition wrapper for your state change. Two upgrades build naturally on top of it: give individual elements a view-transition-name for shared-element morphs, and add @view-transition { navigation: auto; } to animate between full page loads on the same site.
How to use this generator
- Pick an effect and a duration. Shorter feels snappier; 250–400ms suits most UI state changes.
- Click Toggle Layout to watch the preview animate between grid and list with your settings.
- Copy the code: paste the CSS into your stylesheet and wrap your own DOM change in the JavaScript function.
- Respect reduced motion: the generated CSS includes a prefers-reduced-motion guard that disables the animation for users who ask for calm.
Frequently Asked Questions
Check Out Other Popular Tools
Clock with Milliseconds — Live Digital Clock, Stopwatch & Nanosecond Timer
Live digital clock with milliseconds (.000ms), nanosecond timer, lap stopwatch, and high-resolution timer in your browser.
Loop Video
Repeat video clips in your browser and export a looped WebM file for social posts, demos, and motion loops.
Regex Tester
Test and debug JavaScript regular expressions online. Real-time matching, highlighting, and cheatsheet for developers.
Was this tool helpful?
Comments
Loading comments...