Terminal
1npm install next-view-transitions
Native browser API for page transition animations. Zero JavaScript for the animations themselves — everything is handled by the browser through CSS keyframes and GPU acceleration. The most performant and future-proof solution.
npm install next-view-transitions<ViewTransitions>Link from next-view-transitions::view-transition-* pseudo-elements1npm install next-view-transitions
1import { ViewTransitions } from 'next-view-transitions'23export default function Layout({ children }: { children: React.ReactNode }) {4 return <ViewTransitions>{children}</ViewTransitions>5}
1'use client'23import { Link } from 'next-view-transitions'45export default function Page() {6 return (7 <div>8 <h1>Home Page</h1>9 <Link href="/about">Go to About</Link>10 </div>11 )12}