agentleFS
jgamaraalvjgamaraalv/delivery-loop/.claude/skills/vercel-react-view-transitions/SKILL.md

vercel-react-view-transitions

Skill4 starsChanged 5 months agoMITView on GitHub

Animate React route/page changes, shared elements, and enter/exit/reorder with the View Transition API (`<ViewTransition>`); use for view transitions in React or Next.js.

20 other projects use a version of this, 20 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use agent-browser, requesting-code-review and 7 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • VercelSkill

    agent-browser

    Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

    Also in 5 projects that use this

  • OpenAISkill

    requesting-code-review

    Use when completing tasks, implementing major features, or before merging to verify work meets requirements

    Also in 4 projects that use this

  • VercelSkill

    shadcn

    Pre-built shadcn/ui components for json-render. Use when working with @json-render/shadcn, adding standard UI components to a catalog, or building web UIs with Radix UI + Tailwind CSS components.

    Also in 3 projects that use this

  • CloudflareSkill

    receiving-code-review

    Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation

    Also in 3 projects that use this

  • JetBrainsSkill

    brand-guidelines

    Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

    Also in 3 projects that use this

  • OpenAISkill

    brainstorming

    You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

    Also in 3 projects that use this

  • +1 more from vercel-labs

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 20 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every <ViewTransition> should communicate a spatial relationship or continuity.

    line 12
  2. Very specific:

    Next.js: Do not install react@canary — the App Router already bundles React canary internally.

    line 41
  3. Very specific:

    Only startTransition, useDeferredValue, or Suspense activate VTs.

    line 70
  4. Very specific:

    Always add the reduced motion CSS from references/css-recipes.md to your global stylesheet.

    line 96
  5. Very specific:

    When adding view transitions to an existing app, follow references/implementation.md step by step.

    line 102

“Common” is measured: kept by at least 6 in 10 of the 20 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

React View Transitions

Animate between UI states using the browser's native document.startViewTransition. Declare what with <ViewTransition>, trigger when with startTransition / useDeferredValue / Suspense, control how with CSS classes. Unsupported browsers skip animations gracefully.

When to Animate

Every <ViewTransition> should communicate a spatial relationship or continuity. If you can't articulate what it communicates, don't add it.

Implement all applicable patterns from this list, in this order:

PriorityPatternWhat it communicates
1Shared element (name)"Same thing — going deeper"
2Suspense reveal"Data loaded"
3List identity (per-item key)"Same items, new arrangement"
4State change (enter/exit)"Something appeared/disappeared"
5Route change (layout-level)"Going to a new place"

This 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.

Choosing Animation Style

ContextAnimationWhy
Hierarchical navigation (list → detail)Type-keyed nav-forward / nav-backCommunicates spatial depth
Lateral navigation (tab-to-tab)Bare <ViewTransition> (fade) or default="none"No depth to communicate
Suspense revealenter/exit string propsContent arriving
Revalidation / background refreshdefault="none"Silent — no animation needed

Reserve directional slides for hierarchical navigation (list → detail) and ordered sequences (prev/next photo, carousel, paginated results). For ordered sequences, the direction communicates position: "next" slides from right, "previous" from left. Lateral/unordered navigation (tab-to-tab) should not use directional slides — it falsely implies spatial depth.


Availability

  • 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.
  • Without Next.js: Install react@canary react-dom@canary (ViewTransition is not in stable React).
  • Browser support: Chromium 111+, Firefox 144+, Safari 18.2+. Graceful degradation on unsupported browsers.

Core Concepts

The <ViewTransition> Component

import { ViewTransition } from "react";

<ViewTransition>
  <Component />
</ViewTransition>;

React auto-assigns a unique view-transition-name and calls document.startViewTransition behind the scenes. Never call startViewTransition yourself.

Animation Triggers

TriggerWhen it fires
enter<ViewTransition> first inserted during a Transition
exit<ViewTransition> first removed during a Transition
updateDOM mutations inside a <ViewTransition>. With nested VTs, mutation applies to the innermost one
shareNamed VT unmounts and another with same name mounts in the same Transition

Only startTransition, useDeferredValue, or Suspense activate VTs. Regular setState does not animate.

Critical Placement Rule

<ViewTransition> only activates enter/exit if it appears before any DOM nodes:

// Works
<ViewTransition enter="auto" exit="auto">
  <div>Content</div>
</ViewTransition>

// Broken — div wraps the VT, suppressing enter/exit
<div>
  <ViewTransition enter="auto" exit="auto">
    <div>Content</div>
  </ViewTransition>
</div>

Behaviour is controlled with props ("auto" / "none" / a CSS class / a type-keyed object) and CSS pseudo-elements. See references/patterns.md for the full prop/pseudo-element reference, transition types, shared elements, and the multi-VT interaction rules.


Accessibility

Always add the reduced motion CSS from references/css-recipes.md to your global stylesheet.


Implementation Workflow

When adding view transitions to an existing app, follow references/implementation.md step by step. Start with the audit — do not skip it. Copy the CSS recipes from references/css-recipes.md into the global stylesheet — do not write your own animation CSS.


References

Each file is loaded on demand — read one only when the task needs that depth (progressive disclosure).

  • references/implementation.md — step-by-step workflow for adding VTs to an app (audit → CSS → persistent elements → directional page transitions → Suspense reveals → shared elements → verify), plus common mistakes · read when starting an integration.
  • references/patterns.md — the deep API and pattern catalogue: styling props + CSS pseudo-elements, transition types (addTransitionType, type maps, router.back() caveat), shared element morphs, the core composition patterns (enter/exit, list reorder, composing shared + list identity, force re-enter with key, Suspense reveals), how multiple VTs interact, plus worked patterns (deferred grid, card expand/collapse, type-safe helpers, cross-fade without remount, isolating elements, useOptimistic), events API, animation timing, and troubleshooting · read when implementing or debugging a specific behaviour.
  • references/css-recipes.md — ready-to-use CSS animation recipes (timing variables, fade, slide, directional nav, shared/text morph, scale, persistent element isolation, reduced motion) · read when writing the global stylesheet.
  • references/nextjs.md — Next.js App Router specifics: experimental.viewTransition flag, transitionTypes on next/link, programmatic navigation, server-side filtering, loading.tsx boundaries, same-route dynamic segments, Server Components · read when integrating in Next.js.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.