[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79PBDG0587BZMCD2GYYY4JS":3,"skill-same:01M79PBDG0587BZMCD2GYYY4JS":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":34,"ownerDescription":35,"updatedAt":36,"install":37,"resources":50},"01M79PBDG0587BZMCD2GYYY4JS","react-view-transitions",null,"Guide for implementing smooth, native-feeling animations using React's View Transition API (`\u003CViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter\u002Fexit of components, animate list reorder, implement directional (forward\u002Fback) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.","ankaboot-source\u002Fboucle","ankaboot-source","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F88089122?v=4","01M79P4HZGM4NXFWV0SB0HGQ51","ankaboot","01M79P4J0GNNZ7E7F9B0RZNSNX",2,"MIT","https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Freact-view-transitions\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: react-view-transitions\ndescription: Guide for implementing smooth, native-feeling animations using React's View Transition API (`\u003CViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter\u002Fexit of components, animate list reorder, implement directional (forward\u002Fback) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.\nlicense: MIT\nmetadata:\n  author: vercel\n  version: \"1.0.0\"\n---\n\n# React View Transitions\n\nAnimate between UI states using the browser's native `document.startViewTransition`. Declare *what* with `\u003CViewTransition>`, trigger *when* with `startTransition` \u002F `useDeferredValue` \u002F `Suspense`, control *how* with CSS classes. Unsupported browsers skip animations gracefully.\n\n## When to Animate\n\nEvery `\u003CViewTransition>` should communicate a spatial relationship or continuity. If you can't articulate what it communicates, don't add it.\n\nImplement **all** applicable patterns from this list, in this order:\n\n| Priority | Pattern | What it communicates |\n|----------|---------|---------------------|\n| 1 | **Shared element** (`name`) | \"Same thing — going deeper\" |\n| 2 | **Suspense reveal** | \"Data loaded\" |\n| 3 | **List identity** (per-item `key`) | \"Same items, new arrangement\" |\n| 4 | **State change** (`enter`\u002F`exit`) | \"Something appeared\u002Fdisappeared\" |\n| 5 | **Route change** (layout-level) | \"Going to a new place\" |\n\nThis is an implementation order, not a \"pick one\" list. Implement every pattern that fits the app. Only skip a pattern if the app has no use case for it.\n\n### Choosing Animation Style\n\n| Context | Animation | Why |\n|---------|-----------|-----|\n| Hierarchical navigation (list → detail) | Type-keyed `nav-forward` \u002F `nav-back` | Communicates spatial depth |\n| Lateral navigation (tab-to-tab) | Bare `\u003CViewTransition>` (fade) or `default=\"none\"` | No depth to communicate |\n| Suspense reveal | `enter`\u002F`exit` string props | Content arriving |\n| Revalidation \u002F background refresh | `default=\"none\"` | Silent — no animation needed |\n\nReserve directional slides for hierarchical navigation (list → detail) and ordered sequences (prev\u002Fnext photo, carousel, paginated results). For ordered sequences, the direction communicates position: \"next\" slides from right, \"previous\" from left. Lateral\u002Funordered navigation (tab-to-tab) should not use directional slides — it falsely implies spatial depth.\n\n---\n\n## Availability\n\n- **Next.js:** Do **not** install `react@canary` — the App Router already bundles React canary internally. `ViewTransition` works out of the box. `npm ls react` may show a stable-looking version; this is expected.\n- **Without Next.js:** Install `react@canary react-dom@canary` (`ViewTransition` is not in stable React).\n- Browser support: Chromium 125+ (React needs the v2 object form of `startViewTransition`), Firefox 144+, Safari 18.2+. Graceful degradation on unsupported browsers.\n\n---\n\n## Implementation Workflow\n\nWhen adding view transitions to an existing app, **follow [references\u002Fimplementation.md](references\u002Fimplementation.md) step by step.** Start with the audit — do not skip it. Copy the CSS recipes from [references\u002Fcss-recipes.md](references\u002Fcss-recipes.md) into the global stylesheet — do not write your own animation CSS.\n\n---\n\n## Core Concepts\n\n### The `\u003CViewTransition>` Component\n\n```jsx\nimport { ViewTransition } from 'react';\n\n\u003CViewTransition>\n  \u003CComponent \u002F>\n\u003C\u002FViewTransition>\n```\n\nReact auto-assigns a unique `view-transition-name` and calls `document.startViewTransition` behind the scenes. Never call `startViewTransition` yourself.\n\n### Animation Triggers\n\n| Trigger | When it fires |\n|---------|--------------|\n| **enter** | `\u003CViewTransition>` first inserted during a Transition |\n| **exit** | `\u003CViewTransition>` first removed during a Transition |\n| **update** | DOM mutations inside a `\u003CViewTransition>`, or the boundary itself changing size\u002Fposition due to an immediate sibling. With nested VTs, mutation applies to the innermost one |\n| **share** | Named VT unmounts and another with same `name` mounts in the same Transition |\n\nOnly `startTransition`, `useDeferredValue`, or `Suspense` activate VTs. Regular `setState` does not animate.\n\n### Critical Placement Rule\n\n`\u003CViewTransition>` only activates enter\u002Fexit if it appears **before any DOM nodes**:\n\n```jsx\n\u002F\u002F Works\n\u003CViewTransition enter=\"auto\" exit=\"auto\">\n  \u003Cdiv>Content\u003C\u002Fdiv>\n\u003C\u002FViewTransition>\n\n\u002F\u002F Broken — div wraps the VT, suppressing enter\u002Fexit\n\u003Cdiv>\n  \u003CViewTransition enter=\"auto\" exit=\"auto\">\n    \u003Cdiv>Content\u003C\u002Fdiv>\n  \u003C\u002FViewTransition>\n\u003C\u002Fdiv>\n```\n\n---\n\n## Styling with View Transition Classes\n\n### Props\n\nValues: `\"auto\"` (browser cross-fade), `\"none\"` (disabled), `\"class-name\"` (custom CSS), or `{ [type]: value }` for type-specific animations.\n\n```jsx\n\u003CViewTransition default=\"none\" enter=\"slide-in\" exit=\"slide-out\" share=\"morph\" \u002F>\n```\n\nIf `default` is `\"none\"`, all triggers are off unless explicitly listed.\n\n### CSS Pseudo-Elements\n\n- `::view-transition-old(.class)` — outgoing snapshot\n- `::view-transition-new(.class)` — incoming snapshot\n- `::view-transition-group(.class)` — container\n- `::view-transition-image-pair(.class)` — old + new pair\n\nSee [references\u002Fcss-recipes.md](references\u002Fcss-recipes.md) for ready-to-use animation recipes.\n\n---\n\n## Transition Types\n\nTag transitions with `addTransitionType` so VTs can pick different animations based on context. Call it multiple times to stack types — different VTs in the tree react to different types:\n\n```jsx\nstartTransition(() => {\n  addTransitionType('nav-forward');\n  addTransitionType('select-item');\n  router.push('\u002Fdetail\u002F1');\n});\n```\n\nPass an object to map types to CSS classes. Works on `enter`, `exit`, **and** `share`:\n\n```jsx\n\u003CViewTransition\n  enter={{ 'nav-forward': 'slide-from-right', 'nav-back': 'slide-from-left', default: 'none' }}\n  exit={{ 'nav-forward': 'slide-to-left', 'nav-back': 'slide-to-right', default: 'none' }}\n  share={{ 'nav-forward': 'morph-forward', 'nav-back': 'morph-back', default: 'morph' }}\n  default=\"none\"\n>\n  \u003CPage \u002F>\n\u003C\u002FViewTransition>\n```\n\n`enter` and `exit` don't have to be symmetric. For example, fade in but slide out directionally:\n\n```jsx\n\u003CViewTransition\n  enter={{ 'nav-forward': 'fade-in', 'nav-back': 'fade-in', default: 'none' }}\n  exit={{ 'nav-forward': 'nav-forward', 'nav-back': 'nav-back', default: 'none' }}\n  default=\"none\"\n>\n```\n\n**TypeScript:** `ViewTransitionClassPerType` requires a `default` key in the object.\n\nFor apps with multiple pages, extract the type-keyed VT into a reusable wrapper:\n\n```jsx\nexport function DirectionalTransition({ children }: { children: React.ReactNode }) {\n  return (\n    \u003CViewTransition\n      enter={{ 'nav-forward': 'nav-forward', 'nav-back': 'nav-back', default: 'none' }}\n      exit={{ 'nav-forward': 'nav-forward', 'nav-back': 'nav-back', default: 'none' }}\n      default=\"none\"\n    >\n      {children}\n    \u003C\u002FViewTransition>\n  );\n}\n```\n\n### `router.back()` and Browser Back Button\n\n`router.back()` and the browser's back\u002Fforward buttons carry **no transition types**, so type-keyed animations (directional slides) resolve to their `default` and don't play — untyped shared-element morphs still apply. For typed animations, use `router.push()` with an explicit URL.\n\n### Types and Suspense\n\nTypes are available during navigation but **not** during subsequent Suspense reveals (separate transitions, no type). Use type maps for page-level enter\u002Fexit; use simple string props for Suspense reveals.\n\n---\n\n## Shared Element Transitions\n\nSame `name` on two VTs — one unmounting, one mounting — creates a shared element morph:\n\n```jsx\n\u003CViewTransition name=\"hero-image\">\n  \u003Cimg src=\"\u002Fthumb.jpg\" onClick={() => startTransition(() => onSelect())} \u002F>\n\u003C\u002FViewTransition>\n\n\u002F\u002F On the other view — same name\n\u003CViewTransition name=\"hero-image\">\n  \u003Cimg src=\"\u002Ffull.jpg\" \u002F>\n\u003C\u002FViewTransition>\n```\n\n- Only one VT with a given `name` can be mounted at a time — use unique names (`photo-${id}`). Watch for reusable components: if a component with a named VT is rendered in both a modal\u002Fpopover *and* a page, both mount simultaneously and break the morph. Either make the name conditional (via a prop) or move the named VT out of the shared component into the specific consumer.\n- `share` takes precedence over `enter`\u002F`exit`. Think through each navigation path: when no matching pair forms (e.g., the target page doesn't have the same name), `enter`\u002F`exit` fires instead. Consider whether the element needs a fallback animation for those paths.\n- Two ways a wired-up morph silently never fires: (1) `default=\"none\"` with no explicit `share` prop — share resolves to none; (2) type-keyed `share` where the navigation never adds the type — a plain link click resolves the map's `default`. Every link that should morph must add the type (`transitionTypes` on `next\u002Flink`, or `addTransitionType`).\n- Never use a fade-out exit on pages with shared morphs — use a directional slide instead.\n\n---\n\n## Common Patterns\n\n### Enter\u002FExit\n\n```jsx\n{show && (\n  \u003CViewTransition enter=\"fade-in\" exit=\"fade-out\">\u003CPanel \u002F>\u003C\u002FViewTransition>\n)}\n```\n\n### List Reorder\n\n```jsx\n{items.map(item => (\n  \u003CViewTransition key={item.id}>\u003CItemCard item={item} \u002F>\u003C\u002FViewTransition>\n))}\n```\n\nTrigger inside `startTransition`. Avoid wrapper `\u003Cdiv>`s between list and VT.\n\n### Layout Displacement Morph\n\nOnly content inside an activated boundary animates position — everything else teleports to its new layout spot. Wrap the sibling content below a growing\u002Fshrinking list in a bare `\u003CViewTransition>` so it glides instead of jumping. See [Layout Displacement Morph](references\u002Fpatterns.md#layout-displacement-morph).\n\n### Composing Shared Elements with List Identity\n\nShared elements and list identity are independent concerns — don't confuse one for the other. When a list item contains a shared element (e.g., an image that morphs into a detail view), use two nested `\u003CViewTransition>` boundaries:\n\n```jsx\n{items.map(item => (\n  \u003CViewTransition key={item.id}>                                      {\u002F* list identity *\u002F}\n    \u003CLink href={`\u002Fitems\u002F${item.id}`}>\n      \u003CViewTransition name={`item-image-${item.id}`} share=\"morph\">   {\u002F* shared element *\u002F}\n        \u003CImage src={item.image} \u002F>\n      \u003C\u002FViewTransition>\n      \u003Cp>{item.name}\u003C\u002Fp>\n    \u003C\u002FLink>\n  \u003C\u002FViewTransition>\n))}\n```\n\nThe outer VT handles list reorder\u002Fenter animations. The inner VT handles the cross-route shared element morph. Missing either layer means that animation silently doesn't happen.\n\n### Force Re-Enter with `key`\n\n```jsx\n\u003CViewTransition key={searchParams.toString()} enter=\"slide-up\" default=\"none\">\n  \u003CResultsGrid \u002F>\n\u003C\u002FViewTransition>\n```\n\n**Caution:** If wrapping `\u003CSuspense>`, changing `key` remounts the boundary and refetches.\n\n### Suspense Fallback to Content\n\nSimple cross-fade:\n```jsx\n\u003CViewTransition>\n  \u003CSuspense fallback={\u003CSkeleton \u002F>}>\u003CContent \u002F>\u003C\u002FSuspense>\n\u003C\u002FViewTransition>\n```\n\nDirectional reveal:\n```jsx\n\u003CSuspense fallback={\u003CViewTransition exit=\"slide-down\">\u003CSkeleton \u002F>\u003C\u002FViewTransition>}>\n  \u003CViewTransition enter=\"slide-up\" default=\"none\">\u003CContent \u002F>\u003C\u002FViewTransition>\n\u003C\u002FSuspense>\n```\n\nFor more patterns, see [references\u002Fpatterns.md](references\u002Fpatterns.md).\n\n---\n\n## How Multiple VTs Interact\n\nEvery VT matching the trigger fires simultaneously in a single `document.startViewTransition`. VTs in **different** transitions (navigation vs later Suspense resolve) don't compete.\n\n### Use `default=\"none\"` Deliberately\n\nWithout it, every VT fires the browser cross-fade on **every** transition — Suspense resolves, `useDeferredValue` updates, background revalidations. Use `default=\"none\"` on named\u002Fshared elements and type-keyed page VTs.\n\nBut it also turns off `update` (layout\u002Freflow morphs) and `share` (a named pair with no explicit `share` prop never morphs). Keyed list items and displaced siblings *want* update — leave them bare or set `update=\"auto\"`.\n\n### Two Patterns Coexist\n\n**Pattern A — Directional slides:** Type-keyed VT on each page, fires during navigation.\n**Pattern B — Suspense reveals:** Simple string props, fires when data loads (no type).\n\nThey coexist because they fire at different moments. `default=\"none\"` on both prevents cross-interference. Always pair `enter` with `exit`. Place directional VTs in page components, not layouts.\n\n### Nested VT Limitation\n\nWhen a parent VT mounts\u002Funmounts **as one unit** with nested VTs inside it, the nested ones do not fire their own enter\u002Fexit — only the outermost VT animates. (A child VT mounted inside a *persistent* parent VT fires enter\u002Fexit normally.) Per-item staggered animations during page navigation are not possible today; the experimental opt-in is the `parentEnter`\u002F`parentExit` props ([react#36690](https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fpull\u002F36690), experimental channel only).\n\n---\n\n## Next.js Integration\n\nFor Next.js setup (`experimental.viewTransition` flag, `transitionTypes` prop on `next\u002Flink`, App Router patterns, Server Components), see [references\u002Fnextjs.md](references\u002Fnextjs.md).\n\n---\n\n## Accessibility\n\nAlways add the reduced motion CSS from [references\u002Fcss-recipes.md](references\u002Fcss-recipes.md#reduced-motion) to your global stylesheet.\n\n---\n\n## Reference Files\n\n- **[references\u002Fimplementation.md](references\u002Fimplementation.md)** — Step-by-step implementation workflow.\n- **[references\u002Fpatterns.md](references\u002Fpatterns.md)** — Patterns, animation timing, events API, troubleshooting.\n- **[references\u002Fcss-recipes.md](references\u002Fcss-recipes.md)** — Ready-to-use CSS animation recipes.\n- **[references\u002Fnextjs.md](references\u002Fnextjs.md)** — Next.js App Router patterns and Server Component details.\n\n## Full Compiled Document\n\nFor the complete guide with all reference files expanded: `AGENTS.md`\n","# React View Transitions\n\nAnimate between UI states using the browser's native `document.startViewTransition`. Declare *what* with `\u003CViewTransition>`, trigger *when* with `startTransition` \u002F `useDeferredValue` \u002F `Suspense`, control *how* with CSS classes. Unsupported browsers skip animations gracefully.\n\n## When to Animate\n\nEvery `\u003CViewTransition>` should communicate a spatial relationship or continuity. If you can't articulate what it communicates, don't add it.\n\nImplement **all** applicable patterns from this list, in this order:\n\n| Priority | Pattern | What it communicates |\n|----------|---------|---------------------|\n| 1 | **Shared element** (`name`) | \"Same thing — going deeper\" |\n| 2 | **Suspense reveal** | \"Data loaded\" |\n| 3 | **List identity** (per-item `key`) | \"Same items, new arrangement\" |\n| 4 | **State change** (`enter`\u002F`exit`) | \"Something appeared\u002Fdisappeared\" |\n| 5 | **Route change** (layout-level) | \"Going to a new place\" |\n\nThis is an implementation order, not a \"pick one\" list. Implement every pattern that fits the app. Only skip a pattern if the app has no use case for it.\n\n### Choosing Animation Style\n\n| Context | Animation | Why |\n|---------|-----------|-----|\n| Hierarchical navigation (list → detail) | Type-keyed `nav-forward` \u002F `nav-back` | Communicates spatial depth |\n| Lateral navigation (tab-to-tab) | Bare `\u003CViewTransition>` (fade) or `default=\"none\"` | No depth to communicate |\n| Suspense reveal | `enter`\u002F`exit` string props | Content arriving |\n| Revalidation \u002F background refresh | `default=\"none\"` | Silent — no animation needed |\n\nReserve directional slides for hierarchical navigation (list → detail) and ordered sequences (prev\u002Fnext photo, carousel, paginated results). For ordered sequences, the direction communicates position: \"next\" slides from right, \"previous\" from left. Lateral\u002Funordered navigation (tab-to-tab) should not use directional slides — it falsely implies spatial depth.\n\n---\n\n## Availability\n\n- **Next.js:** Do **not** install `react@canary` — the App Router already bundles React canary internally. `ViewTransition` works out of the box. `npm ls react` may show a stable-looking version; this is expected.\n- **Without Next.js:** Install `react@canary react-dom@canary` (`ViewTransition` is not in stable React).\n- Browser support: Chromium 125+ (React needs the v2 object form of `startViewTransition`), Firefox 144+, Safari 18.2+. Graceful degradation on unsupported browsers.\n\n---\n\n## Implementation Workflow\n\nWhen adding view transitions to an existing app, **follow [references\u002Fimplementation.md](references\u002Fimplementation.md) step by step.** Start with the audit — do not skip it. Copy the CSS recipes from [references\u002Fcss-recipes.md](references\u002Fcss-recipes.md) into the global stylesheet — do not write your own animation CSS.\n\n---\n\n## Core Concepts\n\n### The `\u003CViewTransition>` Component\n\n```jsx\nimport { ViewTransition } from 'react';\n\n\u003CViewTransition>\n  \u003CComponent \u002F>\n\u003C\u002FViewTransition>\n```\n\nReact auto-assigns a unique `view-transition-name` and calls `document.startViewTransition` behind the scenes. Never call `startViewTransition` yourself.\n\n### Animation Triggers\n\n| Trigger | When it fires |\n|---------|--------------|\n| **enter** | `\u003CViewTransition>` first inserted during a Transition |\n| **exit** | `\u003CViewTransition>` first removed during a Transition |\n| **update** | DOM mutations inside a `\u003CViewTransition>`, or the boundary itself changing size\u002Fposition due to an immediate sibling. With nested VTs, mutation applies to the innermost one |\n| **share** | Named VT unmounts and another with same `name` mounts in the same Transition |\n\nOnly `startTransition`, `useDeferredValue`, or `Suspense` activate VTs. Regular `setState` does not animate.\n\n### Critical Placement Rule\n\n`\u003CViewTransition>` only activates enter\u002Fexit if it appears **before any DOM nodes**:\n\n```jsx\n\u002F\u002F Works\n\u003CViewTransition enter=\"auto\" exit=\"auto\">\n  \u003Cdiv>Content\u003C\u002Fdiv>\n\u003C\u002FViewTransition>\n\n\u002F\u002F Broken — div wraps the VT, suppressing enter\u002Fexit\n\u003Cdiv>\n  \u003CViewTransition enter=\"auto\" exit=\"auto\">\n    \u003Cdiv>Content\u003C\u002Fdiv>\n  \u003C\u002FViewTransition>\n\u003C\u002Fdiv>\n```\n\n---\n\n## Styling with View Transition Classes\n\n### Props\n\nValues: `\"auto\"` (browser cross-fade), `\"none\"` (disabled), `\"class-name\"` (custom CSS), or `{ [type]: value }` for type-specific animations.\n\n```jsx\n\u003CViewTransition default=\"none\" enter=\"slide-in\" exit=\"slide-out\" share=\"morph\" \u002F>\n```\n\nIf `default` is `\"none\"`, all triggers are off unless explicitly listed.\n\n### CSS Pseudo-Elements\n\n- `::view-transition-old(.class)` — outgoing snapshot\n- `::view-transition-new(.class)` — incoming snapshot\n- `::view-transition-group(.class)` — container\n- `::view-transition-image-pair(.class)` — old + new pair\n\nSee [references\u002Fcss-recipes.md](references\u002Fcss-recipes.md) for ready-to-use animation recipes.\n\n---\n\n## Transition Types\n\nTag transitions with `addTransitionType` so VTs can pick different animations based on context. Call it multiple times to stack types — different VTs in the tree react to different types:\n\n```jsx\nstartTransition(() => {\n  addTransitionType('nav-forward');\n  addTransitionType('select-item');\n  router.push('\u002Fdetail\u002F1');\n});\n```\n\nPass an object to map types to CSS classes. Works on `enter`, `exit`, **and** `share`:\n\n```jsx\n\u003CViewTransition\n  enter={{ 'nav-forward': 'slide-from-right', 'nav-back': 'slide-from-left', default: 'none' }}\n  exit={{ 'nav-forward': 'slide-to-left', 'nav-back': 'slide-to-right', default: 'none' }}\n  share={{ 'nav-forward': 'morph-forward', 'nav-back': 'morph-back', default: 'morph' }}\n  default=\"none\"\n>\n  \u003CPage \u002F>\n\u003C\u002FViewTransition>\n```\n\n`enter` and `exit` don't have to be symmetric. For example, fade in but slide out directionally:\n\n```jsx\n\u003CViewTransition\n  enter={{ 'nav-forward': 'fade-in', 'nav-back': 'fade-in', default: 'none' }}\n  exit={{ 'nav-forward': 'nav-forward', 'nav-back': 'nav-back', default: 'none' }}\n  default=\"none\"\n>\n```\n\n**TypeScript:** `ViewTransitionClassPerType` requires a `default` key in the object.\n\nFor apps with multiple pages, extract the type-keyed VT into a reusable wrapper:\n\n```jsx\nexport function DirectionalTransition({ children }: { children: React.ReactNode }) {\n  return (\n    \u003CViewTransition\n      enter={{ 'nav-forward': 'nav-forward', 'nav-back': 'nav-back', default: 'none' }}\n      exit={{ 'nav-forward': 'nav-forward', 'nav-back': 'nav-back', default: 'none' }}\n      default=\"none\"\n    >\n      {children}\n    \u003C\u002FViewTransition>\n  );\n}\n```\n\n### `router.back()` and Browser Back Button\n\n`router.back()` and the browser's back\u002Fforward buttons carry **no transition types**, so type-keyed animations (directional slides) resolve to their `default` and don't play — untyped shared-element morphs still apply. For typed animations, use `router.push()` with an explicit URL.\n\n### Types and Suspense\n\nTypes are available during navigation but **not** during subsequent Suspense reveals (separate transitions, no type). Use type maps for page-level enter\u002Fexit; use simple string props for Suspense reveals.\n\n---\n\n## Shared Element Transitions\n\nSame `name` on two VTs — one unmounting, one mounting — creates a shared element morph:\n\n```jsx\n\u003CViewTransition name=\"hero-image\">\n  \u003Cimg src=\"\u002Fthumb.jpg\" onClick={() => startTransition(() => onSelect())} \u002F>\n\u003C\u002FViewTransition>\n\n\u002F\u002F On the other view — same name\n\u003CViewTransition name=\"hero-image\">\n  \u003Cimg src=\"\u002Ffull.jpg\" \u002F>\n\u003C\u002FViewTransition>\n```\n\n- Only one VT with a given `name` can be mounted at a time — use unique names (`photo-${id}`). Watch for reusable components: if a component with a named VT is rendered in both a modal\u002Fpopover *and* a page, both mount simultaneously and break the morph. Either make the name conditional (via a prop) or move the named VT out of the shared component into the specific consumer.\n- `share` takes precedence over `enter`\u002F`exit`. Think through each navigation path: when no matching pair forms (e.g., the target page doesn't have the same name), `enter`\u002F`exit` fires instead. Consider whether the element needs a fallback animation for those paths.\n- Two ways a wired-up morph silently never fires: (1) `default=\"none\"` with no explicit `share` prop — share resolves to none; (2) type-keyed `share` where the navigation never adds the type — a plain link click resolves the map's `default`. Every link that should morph must add the type (`transitionTypes` on `next\u002Flink`, or `addTransitionType`).\n- Never use a fade-out exit on pages with shared morphs — use a directional slide instead.\n\n---\n\n## Common Patterns\n\n### Enter\u002FExit\n\n```jsx\n{show && (\n  \u003CViewTransition enter=\"fade-in\" exit=\"fade-out\">\u003CPanel \u002F>\u003C\u002FViewTransition>\n)}\n```\n\n### List Reorder\n\n```jsx\n{items.map(item => (\n  \u003CViewTransition key={item.id}>\u003CItemCard item={item} \u002F>\u003C\u002FViewTransition>\n))}\n```\n\nTrigger inside `startTransition`. Avoid wrapper `\u003Cdiv>`s between list and VT.\n\n### Layout Displacement Morph\n\nOnly content inside an activated boundary animates position — everything else teleports to its new layout spot. Wrap the sibling content below a growing\u002Fshrinking list in a bare `\u003CViewTransition>` so it glides instead of jumping. See [Layout Displacement Morph](references\u002Fpatterns.md#layout-displacement-morph).\n\n### Composing Shared Elements with List Identity\n\nShared elements and list identity are independent concerns — don't confuse one for the other. When a list item contains a shared element (e.g., an image that morphs into a detail view), use two nested `\u003CViewTransition>` boundaries:\n\n```jsx\n{items.map(item => (\n  \u003CViewTransition key={item.id}>                                      {\u002F* list identity *\u002F}\n    \u003CLink href={`\u002Fitems\u002F${item.id}`}>\n      \u003CViewTransition name={`item-image-${item.id}`} share=\"morph\">   {\u002F* shared element *\u002F}\n        \u003CImage src={item.image} \u002F>\n      \u003C\u002FViewTransition>\n      \u003Cp>{item.name}\u003C\u002Fp>\n    \u003C\u002FLink>\n  \u003C\u002FViewTransition>\n))}\n```\n\nThe outer VT handles list reorder\u002Fenter animations. The inner VT handles the cross-route shared element morph. Missing either layer means that animation silently doesn't happen.\n\n### Force Re-Enter with `key`\n\n```jsx\n\u003CViewTransition key={searchParams.toString()} enter=\"slide-up\" default=\"none\">\n  \u003CResultsGrid \u002F>\n\u003C\u002FViewTransition>\n```\n\n**Caution:** If wrapping `\u003CSuspense>`, changing `key` remounts the boundary and refetches.\n\n### Suspense Fallback to Content\n\nSimple cross-fade:\n```jsx\n\u003CViewTransition>\n  \u003CSuspense fallback={\u003CSkeleton \u002F>}>\u003CContent \u002F>\u003C\u002FSuspense>\n\u003C\u002FViewTransition>\n```\n\nDirectional reveal:\n```jsx\n\u003CSuspense fallback={\u003CViewTransition exit=\"slide-down\">\u003CSkeleton \u002F>\u003C\u002FViewTransition>}>\n  \u003CViewTransition enter=\"slide-up\" default=\"none\">\u003CContent \u002F>\u003C\u002FViewTransition>\n\u003C\u002FSuspense>\n```\n\nFor more patterns, see [references\u002Fpatterns.md](references\u002Fpatterns.md).\n\n---\n\n## How Multiple VTs Interact\n\nEvery VT matching the trigger fires simultaneously in a single `document.startViewTransition`. VTs in **different** transitions (navigation vs later Suspense resolve) don't compete.\n\n### Use `default=\"none\"` Deliberately\n\nWithout it, every VT fires the browser cross-fade on **every** transition — Suspense resolves, `useDeferredValue` updates, background revalidations. Use `default=\"none\"` on named\u002Fshared elements and type-keyed page VTs.\n\nBut it also turns off `update` (layout\u002Freflow morphs) and `share` (a named pair with no explicit `share` prop never morphs). Keyed list items and displaced siblings *want* update — leave them bare or set `update=\"auto\"`.\n\n### Two Patterns Coexist\n\n**Pattern A — Directional slides:** Type-keyed VT on each page, fires during navigation.\n**Pattern B — Suspense reveals:** Simple string props, fires when data loads (no type).\n\nThey coexist because they fire at different moments. `default=\"none\"` on both prevents cross-interference. Always pair `enter` with `exit`. Place directional VTs in page components, not layouts.\n\n### Nested VT Limitation\n\nWhen a parent VT mounts\u002Funmounts **as one unit** with nested VTs inside it, the nested ones do not fire their own enter\u002Fexit — only the outermost VT animates. (A child VT mounted inside a *persistent* parent VT fires enter\u002Fexit normally.) Per-item staggered animations during page navigation are not possible today; the experimental opt-in is the `parentEnter`\u002F`parentExit` props ([react#36690](https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fpull\u002F36690), experimental channel only).\n\n---\n\n## Next.js Integration\n\nFor Next.js setup (`experimental.viewTransition` flag, `transitionTypes` prop on `next\u002Flink`, App Router patterns, Server Components), see [references\u002Fnextjs.md](references\u002Fnextjs.md).\n\n---\n\n## Accessibility\n\nAlways add the reduced motion CSS from [references\u002Fcss-recipes.md](references\u002Fcss-recipes.md#reduced-motion) to your global stylesheet.\n\n---\n\n## Reference Files\n\n- **[references\u002Fimplementation.md](references\u002Fimplementation.md)** — Step-by-step implementation workflow.\n- **[references\u002Fpatterns.md](references\u002Fpatterns.md)** — Patterns, animation timing, events API, troubleshooting.\n- **[references\u002Fcss-recipes.md](references\u002Fcss-recipes.md)** — Ready-to-use CSS animation recipes.\n- **[references\u002Fnextjs.md](references\u002Fnextjs.md)** — Next.js App Router patterns and Server Component details.\n\n## Full Compiled Document\n\nFor the complete guide with all reference files expanded: `AGENTS.md`\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25,"version":26},"vercel","1.0.0","main","b1e46a5b01665a6910c6cfc503880b3156429f73",".jcode\u002Fskills\u002Freact-view-transitions",0,"https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle","https:\u002F\u002Fboucle.dev","https:\u002F\u002Fgithub.com\u002Fankaboot-source","https:\u002F\u002Fwww.ankaboot.io\u002F","customer-engagement tech · privacy by design","2026-11-14 05:53:11",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add ankaboot-source\u002Fboucle --skill react-view-transitions",{"tool":43,"command":44},"bunx","bunx skills add ankaboot-source\u002Fboucle --skill react-view-transitions",{"tool":46,"command":47},"pnpm","pnpm dlx skills add ankaboot-source\u002Fboucle --skill react-view-transitions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Freact-view-transitions\u002FSKILL.md",true,[51,57,61,65],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fcss-recipes.md","REFERENCE","参考文档",8104,"https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Freact-view-transitions\u002Freferences\u002Fcss-recipes.md",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fimplementation.md",11036,"https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Freact-view-transitions\u002Freferences\u002Fimplementation.md",{"path":62,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fnextjs.md",9159,"https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Freact-view-transitions\u002Freferences\u002Fnextjs.md",{"path":66,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fpatterns.md",14977,"https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Freact-view-transitions\u002Freferences\u002Fpatterns.md",[70,79,86,93,102,109],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":75,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M79PEWFFK2Z3D0MB2681C6P7","boucle","The boucle protocol — the labels, markers, state machine and handoff rules a\nboucle loop speaks. Use when interacting with a boucle loop on any consumer\nrepository: reading or writing boucle:* labels, emitting or parsing\n\u003C!-- boucle:* --> markers, posting a SHA-anchored verdict, driving an issue\nthrough triage\u002Fworker\u002Freviewer\u002Fe2e, or answering \"what is this loop waiting\non\". Runtime-agnostic and forge-agnostic (GitLab and GitHub).","AGPL-3.0","https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M79PEN7B3R3TJ19FZFZHTGPW","wrangler","Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.","https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Fwrangler\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M79PEE1ZRT65Z4AW0N7X9D3C","web-design-guidelines","Web platform design and accessibility guidelines. Use when building web interfaces, auditing accessibility, implementing responsive layouts, or reviewing web UI code. Triggers on tasks involving HTML, CSS, web components, WCAG compliance, responsive design, or web performance.","https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Fweb-design-guidelines\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":97,"licenseFileUrl":98,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M79PE7NFMZCVF5BQ7CNHP73Y","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":19},"01M79PE4AYTMSWM8C35RQ780YK","wayfinder","Plan a huge chunk of work — more than one agent session can hold — as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.","https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Fwayfinder\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":19},"01M79PE17KCVNPPFRDW5BN76PW","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fankaboot-source\u002Fboucle\u002Fblob\u002Fmain\u002F.jcode\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[]]