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

vercel-react-view-transitions

Skill0 starsChanged 4 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.

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

Adopted by

Most recently taken up by

Used with

Projects with it also use react-email, remotion-maps and 9 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

    react-email

    React Email renderer for json-render that turns JSON specs into HTML or plain-text emails using @react-email/components and @react-email/render. Use when working with @json-render/react-email, building transactional or marketing emails from JSON, creating email catalogs, rendering AI-generated email specs, or when the user mentions react-email, HTML email, or transactional email.

    Also in 3 projects that use this

  • OpenAISkill

    remotion-maps

    Remotion Map animation knowledge

    Also in 3 projects that use this

  • OpenAISkill

    remotion-render

    Export a Remotion video

    Also in 4 projects that use this

  • studio-lgtmSkill

    make-interfaces-feel-better

    Apply design engineering best practices to polish UI components - use when reviewing or improving interfaces, animations, typography, or interaction details.

    Also in 3 projects that use this

  • SentrySkill

    next-best-practices

    Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

    Also in 3 projects that use this

  • JetBrainsSkill

    supabase-postgres-best-practices

    Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.

    Also in 4 projects that use this

  • +3 more from openai

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