Renders nothing: it listens for link clicks and runs a View Transition when the pathname changes. This browser ... the View Transitions API.
// app/template.tsx (Next.js)
"use client";
import { usePathname } from "next/navigation";
import { RouteTransition } from "@dbs/ui";
export default function Template({ children }) {
const pathname = usePathname();
return (<><RouteTransition pathname={pathname} basePath="/shop" />{children}</>);
}
/* globals.css */
html.dbs-vt::view-transition-old(root) { animation: 200ms ease-out both fade-out; }
html.dbs-vt::view-transition-new(root) { animation: 300ms ease-in both fade-in; }