vercel-labs/agent-skills

vercel-react-view-transitions

让过渡表达页面关系,区分导航和数据到达的时刻

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

vercel-react-view-transitions 是什么?

vercel-react-view-transitions 指导用React ViewTransition、Transition触发与CSS伪元素实现页面、共享元素、列表和显隐动画。它强调动画表达关系:列表到详情可用前进/返回方向,普通平级Tab不应强加空间深度。

中文说明由本站依据来源整理;英文原文保留在页面下方。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 vercel-react-view-transitions,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 vercel-react-view-transitions

请在 Codex 的当前工作环境中安装并检查 vercel-react-view-transitions 这个 Skill。

项目身份:vercel-labs/agent-skills / vercel-react-view-transitions
来源:https://github.com/vercel-labs/agent-skills/blob/1a2c79d4e6c4a2283dc2c614b6538cbe1ed5ca62/skills/react-view-transitions/SKILL.md
已定位的源文件:skills/react-view-transitions/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 提供React/Next.js与浏览器目标版本、现有导航和目标效果。先读references/implementation.md审查,再按对应css-recipes与Next.js资料实施;API可用性需要结合实际版本确认。

会得到什么

  • 与导航语义相符的动画与CSS,以及共享元素、返回和加载状态的实际检查。

实际使用顺序

  1. 先确认共享元素、Suspense显现、列表身份、状态显隐与路由变化哪些确有场景,不为动效而增加无意义动画。
  2. 由React的ViewTransition与startTransition等触发管理,不自行再调用document.startViewTransition;enter/exit组件需放在相关DOM包装之前。
  3. 共享元素使用一致且唯一的name,旧新视图要在同一Transition中具备可配对内容。导航types与Suspense后续显现是不同时间,分别配置。
  4. 谨慎使用default=none:它能阻止无关淡入,但也可能关掉未显式配置的share/update。加入减少动态效果CSS,并检查不支持浏览器的降级行为。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

教学示例:请用vercel-react-view-transitions审查当前商品列表到详情导航。先核对实际框架版本,再实现唯一商品图片的共享元素过渡,保留loading状态;测试返回、重复卡片和减少动画偏好,不把平级分类Tab改成方向滑动。
预期结果

预期动画与实际页面关系一致;如当前版本不支持,应报告限制而非盲装canary。本站未实施。

使用前先看这些限制

使用条件与边界

  • 原文的版本和浏览器可用性是该绑定快照说明,实施时要核对当前项目,不把Next.js内部React策略泛化到所有React工程。
  • browser back/router.back不携带自定义transition type;嵌套父级整体挂卸也会限制子级enter/exit。
针对这个 Skill 的疑问

常见问题

设置default=none后共享动画为什么没了?

没有显式share时它也可能解析为none;使用type映射但导航没有加对应type,也会落到default。需检查触发与配置是否匹配。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

skills/react-view-transitions/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Guide for implementing smooth, native-feeling animations using React's View Transition API (`<ViewTransition>` 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/exit of components, animate list reorder, implement directional (forward/back) 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.

查看源文件章节 / Source sections
  • 原文:React View Transitions
  • 原文:When to Animate
  • 原文:Choosing Animation Style
  • 原文:Availability
  • 原文:Implementation Workflow
  • 原文:Core Concepts
  • 原文:The `<ViewTransition>` Component
  • 原文:Animation Triggers
  • 原文:Critical Placement Rule
  • 原文:Styling with View Transition Classes
  • 原文:Props
  • 原文:CSS Pseudo-Elements
  • 原文:Transition Types
  • 原文:`router.back()` and Browser Back Button
  • 原文:Types and Suspense
  • 原文:Shared Element Readiness
  • 原文:Shared Element Transitions
  • 原文:Common Patterns
  • 原文:Enter/Exit
  • 原文:List Reorder
  • 原文:Layout Displacement Morph
  • 原文:Composing Shared Elements with List Identity
  • 原文:Force Re-Enter with `key`
  • 原文:Suspense Fallback to Content
  • 原文:How Multiple VTs Interact
  • 原文:Use `default="none"` Deliberately
  • 原文:Two Patterns Coexist
  • 原文:Nested VT Limitation
  • 原文:Next.js Integration
  • 原文:Accessibility
原文: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: | Priority | Pattern | What it communicates | |----------|---------|---------------------| | 1 | **Shared element** (`name`) | "Same thing — going deeper" | | 2 | **Suspense reveal** | "Data loaded" | | 3 | **List identity** (per-item `key`) | "Same items, new arrangement" | | 4 | **State change** (`enter`/`exit`) | "Something appeared/disappeared" | | 5 | **Route change** (page-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

| Context | Animation | Why | |---------|-----------|-----| | Hierarchical navigation (list → detail) | Type-keyed `nav-forward` / `nav-back` | Communicates spatial depth | | Lateral navigation (tab-to-tab) | Bare `<ViewTransition>` (fade) or `default="none"` | No depth to communicate | | Suspense reveal | `enter`/`exit` string props | Content arriving | | Revalidation / background refresh | `default="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:** Use stable `react` and `react-dom` 19.3 or newer (`ViewTransition` and `addTransitionType` became stable in React 19.3). Earlier stable React versions do not include these APIs. - Browser support: Chromium 125+ (React needs the v2 object form of `startViewTransition`), Firefox 144+, Safari 18.2+. Graceful degradation on unsupported browsers. ---

原文:Implementation Workflow

When adding view transitions to an existing app, **follow [references/implementation.md](references/implementation.md) step by step.** Start with the audit — do not skip it. Use [references/css-recipes.md](references/css-recipes.md) for the applicable CSS and adapt it to the app. ---

原文:The `<ViewTransition>` Component

```jsx 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.

文件 SHA256:693acbddd1d2dcf774286867efbc9a5c09dce2da6f21f8e12618187a92f2106a

仓库许可证记录:未提供;skill-declaration-captured-not-interpreted,查看来源。

Skills.sh收录简介 · 2026-07-28

Guide for implementing smooth, native-feeling animations using React's View Transition API (`<ViewTransition>` component, `addTransitionType`, and CSS view…

查看历史简介来源

这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。

历史收录数据

Skill标识vercel-react-view-transitions
来源仓库vercel-labs/agent-skills
榜单快照2026-07-28
榜单口径Skills.sh累计安装量
快照名次240
快照累计安装量87525

历史资料说明

  • 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
  • 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。

此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源