vercel-react-view-transitions

Implement native view transition animations in React and Next.js applications.

Updated May 5, 2026
One-click install
npx skills add https://github.com/UlaYuga/promo-preflight --skill vercel-react-view-transitions-ulayuga
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vercel-react-view-transitions
Source: https://github.com/UlaYuga/promo-preflight/tree/main/.agents/skills/vercel-react-view-transitions
Command: npx skills add https://github.com/UlaYuga/promo-preflight --skill vercel-react-view-transitions-ulayuga

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding smooth, native-feeling animations between UI states in React is error-prone: developers must correctly coordinate <ViewTransition> placement, startTransition triggers, transition types, and CSS pseudo-elements, and small mistakes silently disable animations. ## Core Features & Use Cases - Step-by-step implementation workflow: Audit routes, isolate persistent elements, add directional page transitions, Suspense reveals, and shared element morphs in a defined order. - Ready-to-use CSS recipes: Copy-paste animations for fade, slide, directional navigation, shared element morph, text morph, scale, and reduced-motion support. - Next.js integration guidance: Covers experimental.viewTransition, the transitionTypes prop on next/link, loading.tsx Suspense boundaries, and same-route dynamic segments. - Use Case: When building a photo gallery where tapping a thumbnail should morph the image into a detail page with a directional slide, use this Skill to wire up named shared element transitions and type-keyed page animations correctly. ## Quick Start Add view transitions to my Next.js app so navigating from the product list to a product detail page slides directionally and morphs the product image.

Frequently Asked Questions about vercel-react-view-transitions

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

FAQPage Schema
How do I add page transition animations in React?▼

Wrap page components in the React `<ViewTransition>` component and trigger navigation inside `startTransition`. Use `enter` and `exit` props with CSS classes targeting `::view-transition-old` and `::view-transition-new` pseudo-elements to control the animation.

How do I animate route changes in Next.js App Router?▼

Enable `experimental.viewTransition` in next.config.js so `<Link>` navigations run inside `document.startViewTransition`. Add `transitionTypes` on `<Link>` for directional animations, and place type-keyed `<ViewTransition>` wrappers in page components, not layouts.

Does React ViewTransition work without Next.js?▼

Yes, but you must install `react@canary` and `react-dom@canary` since `<ViewTransition>` is not in stable React. In Next.js the App Router already bundles React canary internally, so no extra install is needed.

Why is my ViewTransition enter or exit animation not firing?▼

Common causes are wrapping the `<ViewTransition>` inside a DOM node instead of placing it first, updating state outside `startTransition`, or nesting it inside a parent VT in a layout. Nested VTs never fire enter/exit inside a parent VT.

How do I create shared element transitions between two views?▼

Give two `<ViewTransition>` components the same unique `name` on the source and target views, with one unmounting and the other mounting in the same transition. Use the `share` prop with a morph CSS class to control the animation.

Why doesn't router.back() trigger view transitions in Next.js?▼

`router.back()` and browser back/forward buttons fire synchronous `popstate` events, which are incompatible with `startViewTransition`. Use `router.push()` with an explicit URL inside `startTransition` with `addTransitionType('nav-back')` instead.