view-transitions

Configure React View Transitions on layouts, routes, and parallel slots in @rangojs/router.

Updated Nov 7, 2025
One-click install
npx skills add https://github.com/rangojs/rango --skill view-transitions-rangojs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: view-transitions
Source: https://github.com/rangojs/rango/tree/main/packages/rangojs-router/skills/view-transitions
Command: npx skills add https://github.com/rangojs/rango --skill view-transitions-rangojs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @rangojs/router.

What problem does it solve? Navigations in a React Server Components app remount content and flash loading skeletons by default, with no animated cross-fade between pages. This Skill wires React's startTransition driving and <ViewTransition> boundaries into the rango route tree so page changes hold stale content and morph smoothly. ## Core Features & Use Cases - Layout and route transitions: Apply transition() inside layout() or path() entries to cross-fade outlet content while keeping shell chrome (navbars, sidebars, modal slots) outside the animated subtree. - Direction-aware and conditional transitions: Key ViewTransitionClass objects by "navigation" or "navigation-back" for directional slides, and gate holds per request with a server-side when predicate reading navigation source, action metadata, and request context. - Boundary opt-out: Set viewTransition: false per segment or globally via createRouter to keep startTransition driving and content-hold while placing your own named <ViewTransition> elements. - Use Case: A gallery app fades between feed pages through a shared layout while intercept modals open in a parallel slot without firing the underlying page transition, and form actions inside the modal revalidate without remounting it. ## Quick Start Add a fade transition to the routes under my shop layout in @rangojs/router so navigating between pages cross-fades the outlet content.

Frequently Asked Questions about view-transitions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add view transitions between routes in @rangojs/router?

Add transition({ default: "page-fade" }) inside a layout() entry so the wrap lands around the layout's <Outlet /> content. Navigations between child routes then cross-fade while the shell chrome stays static, with CSS targeting ::view-transition-old and ::view-transition-new.

How do I make view transitions direction-aware for back navigation?

Pass an object keyed by transition type to any phase prop, such as default: { navigation: "slide-left", "navigation-back": "slide-right" }. Rango tags forward navigations as "navigation" and popstate restores as "navigation-back".

Does @rangojs/router view transition support require React 19?

The startTransition driving and same-route content hold work on all React versions. The router-placed <ViewTransition> cross-fade requires React 19.3+ or an experimental build; on React 19.2 that layer is a no-op while the content hold still applies.

Why does my view transition not fire when opening an intercept modal?

That is intended behavior: mounting a <ParallelOutlet /> slot in a layout keeps the modal outside the layout's transition subtree, so soft navigation to an intercept route fires no view transition. Slot-level transition() is accepted by the DSL but currently a no-op at render time.

How do I use my own ViewTransition elements instead of the router boundary?

Set viewTransition: false on the transition() call or globally via createRouter({ viewTransition: false }). The router still drives navigation through startTransition and holds content, while your own named <ViewTransition> elements animate exactly where placed.

Why does my same-route transition remount instead of holding content?

The same-route hold requires the transition present on the first render, since the param-agnostic key is established at mount. A when predicate returning false on initial load drops the transition, so write source gates that return true when navigation source fields are undefined.