openclaw-skills/vercel-react-view-transitions/SKILL.md
Guide for adding native-feeling page, route, shared-element, and list transitions in React and Next.js with the View Transition API.
npx skillsauth add seaworld008/commonly-used-high-value-skills vercel-react-view-transitionsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Practical guidance for implementing React View Transitions in production UI work. This skill is intended for code generation, refactoring, and review tasks where the goal is to add motion without introducing a heavyweight animation library.
This repository version is an original in-house rewrite informed by the public Vercel skill and related platform guidance. Keep the implementation grounded in React and Next.js behavior, not generic CSS animation habits.
Use this skill when the task involves any of the following:
Do not reach for this skill when the request is mainly about canvas, WebGL, game animation, or highly choreographed motion systems. In those cases, a dedicated animation or rendering approach is more appropriate.
ViewTransition support as experimental and version-sensitive.Think about view transitions as three separate decisions:
If those three decisions are not clear, do not start coding animation classes yet. Audit the UI first.
Before editing code, identify:
Good candidates:
Bad candidates:
Wrap the smallest meaningful UI region, not the whole application by default.
import { ViewTransition } from "react";
export function ProductCard({ children }: { children: React.ReactNode }) {
return (
<ViewTransition>
<article className="product-card">{children}</article>
</ViewTransition>
);
}
Prefer narrow boundaries because broad boundaries often create unnecessary cross-fades and make debugging harder.
Use transition-aware React flows when the UI update is non-urgent.
import { startTransition, useState } from "react";
export function SortableGrid() {
const [sort, setSort] = useState<"popular" | "latest">("popular");
function handleSort(next: "popular" | "latest") {
startTransition(() => {
setSort(next);
});
}
return (
<>
<button onClick={() => handleSort("popular")}>Popular</button>
<button onClick={() => handleSort("latest")}>Latest</button>
</>
);
}
If an update must be immediate and interaction-critical, do not force a transition just for visual effect.
Shared-element motion works only when the old and new elements represent the same conceptual object.
<ViewTransition name={`product-${product.id}`}>
<img src={product.image} alt={product.title} />
</ViewTransition>
Use stable IDs. Never derive names from array index or transient sort order.
Start with a minimal, working transition boundary. Then add motion classes after the render flow is correct.
@media (prefers-reduced-motion: no-preference) {
::view-transition-old(.slide-forward) {
animation: 180ms ease-out both fade-out, 220ms ease-out both slide-left;
}
::view-transition-new(.slide-forward) {
animation: 220ms ease-out both fade-in, 220ms ease-out both slide-in-right;
}
}
@keyframes fade-out {
to { opacity: 0; }
}
@keyframes fade-in {
from { opacity: 0; }
}
@keyframes slide-left {
to { transform: translateX(-16px); }
}
@keyframes slide-in-right {
from { transform: translateX(16px); }
}
Keep timing short. Most navigation transitions feel better in the 150ms to 250ms range than in long cinematic motion.
When reviewing a PR that uses view transitions, check the following:
Avoid these mistakes:
setState callThis skill is not a full animation design system. It does not replace:
If the user needs cinematic sequences, drag physics, or scroll-linked animation systems, switch to a more specialized approach.
When applying this skill, the agent should usually produce:
Prefer continuity over spectacle. A good view transition makes the state change easier to follow, not harder to understand.
development
Enumerating failure modes via pre-mortem analysis. Systematically identifies failure scenarios for plans, designs, and features, scoring them with RPN/AP. Does not write code.
testing
Orchestrating specialist AI agent teams as a meta-coordinator. Decomposes requests into minimum viable chains, spawns each as an independent session in AUTORUN modes, and drives to final output. Use when a task spans multiple specialist domains, requires parallel agent execution, or needs hub-and-spoke routing across the skill ecosystem.
development
Converting document formats (Markdown/Word/Excel/PDF/HTML). Converts specs from Scribe and reports from Harvest into distributable formats; generates reusable conversion scripts. Use when converting documents, building accessibility-compliant PDFs, or creating Pandoc/LibreOffice pipelines.
testing
Curating cross-agent knowledge and guarding institutional memory. Extracts patterns from agent journals into METAPATTERNS.md, detects knowledge decay, propagates best practices, prevents organizational forgetting. Use when consolidating cross-agent insights, curating memory, or auditing knowledge decay.