본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)33k · #8432

vercel-react-view-transitions

하는 일

이 스킬은 React 앱에서 화면과 상태 사이를 이동할 때 애니메이션 전환을 추가하도록 돕습니다. 무거운 애니메이션 코드 없이 세련된 움직임을 원하는 프런트엔드 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓페이지나 라우트 사이를 이동할 때 부드러운 애니메이션을 원할 때.
  • ✓목록의 항목이 상세 화면으로 이어지며 움직이기를 원할 때.
  • ✓목록 항목을 재정렬하거나 추가할 때 애니메이션이 필요한 경우.

스킬 링크

https://github.com/vercel-labs/agent-skills/blob/main/skills/react-view-transitions/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/vercel-labs/agent-skills/blob/main/skills/react-view-transitions/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“사용자가 제품 카드를 눌러 상세 페이지를 열 때 부드러운 전환을 추가해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

ViewTransition 컴포넌트로 무엇이 애니메이션될지 정하고, 전환 훅으로 변경을 시작합니다. 스타일은 CSS 클래스로 설정하며, 지원하지 않는 브라우저는 애니메이션을 안전하게 건너뜁니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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 step by step. Start with the audit — do not skip it. Use references/css-recipes.md for the applicable CSS and adapt it to the app.


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

Trigger When it fires
enter <ViewTransition> first inserted during a Transition
exit <ViewTransition> first removed during a Transition
update DOM mutations inside a <ViewTransition>, or the boundary itself changing size/position due to an immediate sibling. With nested VTs, mutation applies to the innermost one
share Named 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>

Styling with View Transition Classes

Props

Values: "auto" (browser cross-fade), "none" (disabled), "class-name" (custom CSS), or { [type]: value } for type-specific animations.

<ViewTransition default="none" enter="slide-in" exit="slide-out" share="morph" />

If default is "none", all trigge

자주 묻는 질문

구형 브라우저가 깨지나요?

아닙니다. View Transition API를 지원하지 않는 브라우저는 애니메이션을 우아하게 건너뜁니다.

모든 요소를 애니메이션해야 하나요?

아닙니다. 각 애니메이션은 분명한 관계를 보여 주어야 하며, 그렇지 않다면 추가하지 않아야 합니다.

스타일은 어떻게 제어하나요?

CSS 클래스와 뷰 전환 의사 요소를 통해 제어합니다.

상세 정보

작성자의 원본 설명

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 bet

repo: vercel-labs/agent-skills

인기도

GitHub 스타
33k
순위
#8432
라이선스
—
업데이트
2026. 10. 28.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬