page-transitions
Skill1 starsChanged 3 months agoMITView on GitHub
Route transition strategy for ultraweb builds — decide whether routes transition at all, implement the stable template.tsx entrance as the default, and layer Next 16's EXPERIMENTAL View Transitions (experimental.viewTransition + ViewTransition from react) as progressive enhancement with shared-element continuity, and ship the REQUIRED route-change live announcer so screen readers hear each new page (client navigation is otherwise silent). Invoke in the ultraweb motion phase (Phase 9), or whenever the user says "page transitions", "route animations", "smooth navigation between pages", "shared element transition", "view transitions", "screen reader silent on navigation", "route announcer", or "pages pop in abruptly".
1 other project uses a version of this.
Adopted by
Most recently taken up by
- dylantarre/animation-principlestheir own version, first seen Dec 30, 2025
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- dylantarre/animation-principles★ 94same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository79 other files it gives its agents.
- ultrawebSkill
- analyticsSkill
- animejsSkill
- api-designSkill
- app-structureSkill
- assetsSkill
- authSkill
- award-canonSkill
- briefSkill
- buttonsSkill
- cardsSkill
- cartSkill
- checkpointSkill
- colorSkill
- command-paletteSkill
- component-apiSkill
- consentSkill
- content-cmsSkill
- copywritingSkill
- databaseSkill
- data-displaySkill
- data-fetchingSkill
- depthSkill
- directionSkill
- emailSkill
- faqSkill
- feature-sectionsSkill
- footerSkill
- formsSkill
- gate-accessibilitySkill
- gate-antislopSkill
- gate-codeSkill
- gate-contentSkill
- gate-performanceSkill
- gate-responsiveSkill
- gate-visualSkill
- handoffSkill
- heroSkill
- hidden-craftSkill
- i18nSkill
- iconsSkill
- identitySkill
- imagerySkill
- iterateSkill
- layout-gridSkill
- marginaliaSkill
- media-optimizationSkill
- micro-interactionsSkill
- mockupSkill
- motion-languageSkill
- navigationSkill
- overlaysSkill
- paymentsSkill
- physicsSkill
- previewSkill
- pricingSkill
- print-craftSkill
- product-detailSkill
- retrofitSkill
- routingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Read SYSTEM.md §motion and SITEMAP.md.
- Distinctive: line 28
When Tier 2 is on, remove the Tier 1 animation from the routes it covers.
- Very specific: line 117
No reduced-motion gate — route change must be an instant swap under prefers-reduced-motion: reduce.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
page-transitions — navigation never feels slower
Stage: Phase 9 — Motion - Reads: design/SYSTEM.md §motion, design/SITEMAP.md, app/ structure - Writes: app-level transition layer (app/template.tsx, optional next.config.ts flag + ViewTransition wrappers)
Standard
A route transition is seasoning on navigation, never a gate in front of it. First-grade means: 150–300ms, content-only (persistent chrome stays still), instant swap under reduced motion, and — because Next 16 View Transitions are EXPERIMENTAL — the site is complete and correct with transitions absent. "No transition" is a valid first-grade answer; dashboards and rapid-navigation flows are better without one.
- Ceiling: 300ms. The moment a transition makes navigation feel slower, cut it, not the duration alone.
- Two-tier architecture. Tier 1 (default, stable APIs):
template.tsxentrance animation. Tier 2 (enhancement, experimental): View Transitions for cross-route continuity. Never both animating the same surface — that double-fires. - anime.js never owns a route transition. Even on a build where DIRECTION.md commissioned the engine for an SVG moment (
ultraweb:animejs), navigation stays View Transitions /template.tsx/ motion — a third runtime racing the App Router's own commit timing buys nothing Tier 1 doesn't already give for free. A persistent scene never owns one either. The camera move may accompany the cut — that is the point of mapping each route to a window of one clip — buttemplate.tsx/ View Transitions / motion still commit the navigation, and a 3D affordance navigates by emitting a realhrefthe DOM nav already reaches. A canvas cannot cross-fade with itself: prefer the View Transitions API, which snapshots it for free, over a hand-rolledpreserveDrawingBuffer+drawImageclone. - Chrome is stable. Header, nav, footer never transition; only the page content wrapped below them.
- Entrance-only in Tier 1.
template.tsxremounts on navigation but cannot animate exit — the old page unmounts immediately. Accept it; don't hack exit withAnimatePresencearound route children (fragile in App Router). - The Masked Cut — only when DIRECTION.md justifies a full-bleed transition (
award-canon). Cover the swap with one brief full-bleed effect (color-flood, frost, dissolve) and fire the route or heavy swap behind the cover so the load is invisible; an incoming brand-color flood doubles as wayfinding. This is the disciplined form of the full-screen wipe the anti-patterns gate — ONE grammar reused site-wide, reduced-motion → plain crossfade or instant, and never a persistent-canvas SPA just to keep a scene alive across routes — with one commissioned exception, and it is not an SPA: when DIRECTION.md commissions a site-scale scene (ultraweb:set-design), the canvas persists but the App Router still owns navigation. Every route stays a real URL with server-rendered content,<Link>still navigates, the announcer still announces, and the scene is a background that survives the swap — never a router that replaces it. A canvas that intercepts navigation withhistory.pushStateis the banned SPA wearing a commission. - Shared-Element Lift (
award-canon): Browse → Elevate → Read. A picked item lifts into its detail — the same element scales up via a shared-element transition (MotionlayoutIdfor an in-page lift, or Tier 2 View Transitions cross-route) so the reader never loses their place. Even inside a looping/infinite field every card stays a real crawlable<a href>with its own URL (endless field, bounded meaning); browser Back returns to the field at the same scroll position. - Route-change announcer — REQUIRED whenever routes animate (the AA floor, not an enhancement). A
template.tsxentrance or a View Transition is visible but silent: client navigation never fires the browser's native new-document title announcement, so a screen-reader user is never told the page changed. Any animated route flow ships a persistent visually-hiddenaria-live="polite"region that speaks the new page's<h1>/title one paint after the route commits — the audible half of accessible client nav, paired with focus reset (app-structure). See Route announcer below.
Process
- Read SYSTEM.md §motion and SITEMAP.md; pick a strategy from the decision table. Record it in SYSTEM.md §motion.
- Implement Tier 1:
app/template.tsxwith a 200–250ms fade + 8px rise. Template, not layout — layouts persist across navigation and would animate exactly once per session. - Optionally enable Tier 2:
experimental.viewTransition: trueinnext.config.ts,import { ViewTransition } from "react", wrap the transitioning surfaces. Give shared elements (card image → detail image) matchingnameprops for continuity.<Link transitionTypes={[...]}>scopes animation styles per navigation type (per STACK.md). Behavior beyond these verified facts: check current docs first. - When Tier 2 is on, remove the Tier 1 animation from the routes it covers.
- Ship the route announcer (required for ANY animated route flow, Tier 1 or Tier 2): mount
<RouteAnnouncer/>once inapp/layout.tsx, below{children}— see Route announcer below. Skip only when the site chose "None" (no route animates at all). - Reduced motion: transitions become instant swaps — gate the template animation and View Transition CSS behind
prefers-reduced-motion. The announcer is exempt: it carries no motion and stays on under reduced motion. - Verify: click every nav path, use browser back/forward, confirm scroll restoration still works, test in a browser WITHOUT View Transitions support (instant swap must look intentional), console clean; and with a screen reader running (NVDA / VoiceOver), confirm each client route change announces the new page title exactly once.
Decision table
| Site type (BRIEF.md) | Strategy |
| Marketing / brochure | Tier 1 only: template fade + rise, 200–250ms |
| Editorial / portfolio | Tier 1 + Tier 2 shared-element continuity — the one site type where cross-route continuity earns its flag |
| Dashboard / app-like | None on route change; motion lives inside panes (ui-states) |
| E-commerce | Tier 2 on product-card → detail image only; everything else instant |
Tier 1 — template.tsx (stable, the default)
// app/template.tsx — remounts every navigation; layout.tsx does not
"use client";
import { m } from "motion/react"; // app-level LazyMotion(domAnimation) provider required
export default function Template({ children }: { children: React.ReactNode }) {
return (
<m.div
initial={{ opacity: 0, y: 8 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.25, ease: "easeOut" }}
>
{children}
</m.div>
);
}children passed as props stay server components — the client boundary is this wrapper only. Place the template at the segment level that should animate (app root for all routes; a route group to exempt the dashboard).
Tier 2 — View Transitions (experimental enhancement)
// next.config.ts
import type { NextConfig } from "next";
const nextConfig: NextConfig = { experimental: { viewTransition: true } };
export default nextConfig;import { ViewTransition } from "react";
// list page: <ViewTransition name={`cover-${post.slug}`}><Image …/></ViewTransition>
// detail page: same name on the destination image → the browser morphs one into the otherBrowsers without the View Transitions API get an instant swap — that IS the design for them, which is why the underlying pages must look finished without any transition. This flag is experimental: expect API movement, re-verify against current Next docs at build time, and never let a Tier 2 feature become load-bearing for layout or content.
Route announcer — the accessible half of client navigation
Client navigation swaps content inside one live document, so the browser's native "new page" title announcement never fires — a screen-reader user hears nothing when a route (or a View Transition) changes. Ship ONE persistent visually-hidden live region that speaks the new page. It mounts once in app/layout.tsx (never template.tsx: a region that remounts with the route isn't stable in the DOM when its text changes, so the announcement is dropped).
// components/layout/route-announcer.tsx — render ONCE in app/layout.tsx, below {children}
"use client";
import { useEffect, useState } from "react";
import { usePathname } from "next/navigation";
export function RouteAnnouncer() {
const pathname = usePathname();
const [label, setLabel] = useState("");
useEffect(() => {
// title/H1 resolve a paint AFTER the route commits; read next frame, latest read wins
const id = requestAnimationFrame(() => {
const h1 = document.querySelector("main h1")?.textContent?.trim();
setLabel(h1 || document.title);
});
return () => cancelAnimationFrame(id); // coalesces rapid navigations — no stacked announcements
}, [pathname]);
return <div aria-live="polite" role="status" className="sr-only">{label}</div>;
}polite, never assertive — a route change queues behind the user, it doesn't interrupt them. The region is empty on first paint (the native document-load announcement already covers the first page, so this never double-announces) and speaks only on subsequent client navigations. Prefer the <h1> over document.title: the heading is the page's on-screen name and is reliably in the DOM by the next frame, while document.title (set by each page's generateMetadata/metadata export) resolves slightly later and is the fallback. sr-only (Tailwind) keeps the node in the accessibility tree while off-screen — never hidden/display:none, which drops it from screen readers. Moving keyboard focus to that new heading is the other half of accessible client nav and belongs to ultraweb:app-structure: the announcer says what changed, the focus reset says where you are now.
Anti-patterns
- Motion components directly in
layout.tsx— layouts don't remount; the animation plays once, then never again (grepm./motion.in layout.tsx). AnimatePresencein template.tsx/layout.tsx to fake route exit animations — fragile App Router hack; grep for it.- Transition > 300ms — the user is waiting on chrome.
- Animating the header/nav/footer during navigation — persistent chrome must hold still.
- Tier 1 + Tier 2 both active on one route — double animation.
- Full-screen curtain/wipe overlays — portfolio-only move; requires explicit DIRECTION.md justification.
- Shipping
experimental.viewTransitionwithout testing the unsupported-browser path. - No reduced-motion gate — route change must be an instant swap under
prefers-reduced-motion: reduce. - Animating a route (template or View Transition) with no live-region announcer — the swap is visible but silent to a screen reader. Required, not optional.
- Announcer mounted in
template.tsxor a page instead oflayout.tsx— it remounts with the route, so the live region isn't stable when its text changes and the announcement is dropped (grepRouteAnnouncerin template.tsx / page files). aria-live="assertive"orrole="alert"for route announcements — interrupts the user mid-utterance; route changes are polite.
Worked example — Studio Norra, case-study route continuity
Moved to references/example.md — read only when this build's case is genuinely ambiguous; the sections above are the decision material.
Composes with
Moved to references/composes.md — the handoff map; load it when orchestrating this skill against its neighbors.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

