View Transitions API for smooth page transitions, shared element animations, and SPA/MPA navigation in React applications. Use when adding view transitions or page animations.
View on GitHubyonatangross/skillforge-claude-plugin
ork
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/yonatangross/skillforge-claude-plugin/blob/main/plugins/ork/skills/view-transitions/SKILL.md -a claude-code --skill view-transitionsInstallation paths:
.claude/skills/view-transitions/# View Transitions
The View Transitions API provides smooth, native transitions between different views in web applications. Supported in Chrome 126+ and Safari 18.2+.
## Overview
- Page navigation transitions in SPAs
- Cross-document (MPA) transitions
- Shared element animations (image galleries, cards)
- Modal-to-page transitions
- List item to detail view animations
- Tab switching with smooth transitions
## Core Patterns
### 1. React Router 7.x Integration (Simplest)
```tsx
import { Link, NavLink, Form } from 'react-router';
// Enable view transitions on links
<Link to="/about" viewTransition>
About
</Link>
// NavLink with viewTransition
<NavLink to="/dashboard" viewTransition>
Dashboard
</NavLink>
// Form with viewTransition
<Form method="post" viewTransition>
<button type="submit">Save</button>
</Form>
```
### 2. useViewTransitionState Hook
```tsx
import { useViewTransitionState, Link } from 'react-router';
function ProductCard({ product }: { product: Product }) {
const isTransitioning = useViewTransitionState(`/products/${product.id}`);
return (
<Link to={`/products/${product.id}`} viewTransition>
<img
src={product.image}
alt={product.name}
style={{
viewTransitionName: isTransitioning ? 'product-image' : undefined,
}}
/>
</Link>
);
}
// On detail page, match the transition name
function ProductDetail({ product }: { product: Product }) {
return (
<img
src={product.image}
alt={product.name}
style={{ viewTransitionName: 'product-image' }}
/>
);
}
```
### 3. Manual startViewTransition (SPA)
```tsx
function navigateWithTransition(navigate: NavigateFunction, to: string) {
if (!document.startViewTransition) {
navigate(to);
return;
}
document.startViewTransition(() => {
navigate(to);
});
}
// With React state updates
function handleTabChange(newTab: string) {
if (!document.startViewTransition) {
setActiveTab(newTab);