opencode-skills-collection 3.0.35 → 3.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-skills/.antigravity-install-manifest.json +15 -1
- package/bundled-skills/accesslint-audit/SKILL.md +115 -0
- package/bundled-skills/accesslint-diff/SKILL.md +81 -0
- package/bundled-skills/accesslint-scan/SKILL.md +47 -0
- package/bundled-skills/composition-patterns/SKILL.md +87 -0
- package/bundled-skills/composition-patterns/rules/_sections.md +29 -0
- package/bundled-skills/composition-patterns/rules/_template.md +24 -0
- package/bundled-skills/composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/bundled-skills/composition-patterns/rules/architecture-compound-components.md +112 -0
- package/bundled-skills/composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/bundled-skills/composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/bundled-skills/composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/bundled-skills/composition-patterns/rules/state-context-interface.md +191 -0
- package/bundled-skills/composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/bundled-skills/composition-patterns/rules/state-lift-state.md +125 -0
- package/bundled-skills/debugging-toolkit/SKILL.md +35 -0
- package/bundled-skills/deploy-to-vercel/SKILL.md +304 -0
- package/bundled-skills/deploy-to-vercel/resources/deploy-codex.sh +301 -0
- package/bundled-skills/deploy-to-vercel/resources/deploy.sh +301 -0
- package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
- package/bundled-skills/docs/maintainers/backups/README-2026-06-02.md +687 -0
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +4 -4
- package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
- package/bundled-skills/docs/users/bundles.md +245 -1
- package/bundled-skills/docs/users/claude-code-skills.md +1 -1
- package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
- package/bundled-skills/docs/users/getting-started.md +1 -1
- package/bundled-skills/docs/users/kiro-integration.md +1 -1
- package/bundled-skills/docs/users/plugins.md +21 -13
- package/bundled-skills/docs/users/specialized-plugin-roadmap.md +95 -0
- package/bundled-skills/docs/users/usage.md +4 -4
- package/bundled-skills/docs/users/visual-guide.md +4 -4
- package/bundled-skills/polis-protocol/SKILL.md +93 -0
- package/bundled-skills/python-development/SKILL.md +35 -0
- package/bundled-skills/radix-ui-design-system/SKILL.md +2 -2
- package/bundled-skills/react-native-skills/SKILL.md +120 -0
- package/bundled-skills/react-native-skills/rules/_sections.md +86 -0
- package/bundled-skills/react-native-skills/rules/_template.md +28 -0
- package/bundled-skills/react-native-skills/rules/animation-derived-value.md +53 -0
- package/bundled-skills/react-native-skills/rules/animation-gesture-detector-press.md +95 -0
- package/bundled-skills/react-native-skills/rules/animation-gpu-properties.md +65 -0
- package/bundled-skills/react-native-skills/rules/design-system-compound-components.md +66 -0
- package/bundled-skills/react-native-skills/rules/fonts-config-plugin.md +71 -0
- package/bundled-skills/react-native-skills/rules/imports-design-system-folder.md +68 -0
- package/bundled-skills/react-native-skills/rules/js-hoist-intl.md +61 -0
- package/bundled-skills/react-native-skills/rules/list-performance-callbacks.md +44 -0
- package/bundled-skills/react-native-skills/rules/list-performance-function-references.md +132 -0
- package/bundled-skills/react-native-skills/rules/list-performance-images.md +53 -0
- package/bundled-skills/react-native-skills/rules/list-performance-inline-objects.md +97 -0
- package/bundled-skills/react-native-skills/rules/list-performance-item-expensive.md +94 -0
- package/bundled-skills/react-native-skills/rules/list-performance-item-memo.md +82 -0
- package/bundled-skills/react-native-skills/rules/list-performance-item-types.md +104 -0
- package/bundled-skills/react-native-skills/rules/list-performance-virtualize.md +67 -0
- package/bundled-skills/react-native-skills/rules/monorepo-native-deps-in-app.md +46 -0
- package/bundled-skills/react-native-skills/rules/monorepo-single-dependency-versions.md +63 -0
- package/bundled-skills/react-native-skills/rules/navigation-native-navigators.md +188 -0
- package/bundled-skills/react-native-skills/rules/react-compiler-destructure-functions.md +50 -0
- package/bundled-skills/react-native-skills/rules/react-compiler-reanimated-shared-values.md +48 -0
- package/bundled-skills/react-native-skills/rules/react-state-dispatcher.md +91 -0
- package/bundled-skills/react-native-skills/rules/react-state-fallback.md +56 -0
- package/bundled-skills/react-native-skills/rules/react-state-minimize.md +65 -0
- package/bundled-skills/react-native-skills/rules/rendering-no-falsy-and.md +74 -0
- package/bundled-skills/react-native-skills/rules/rendering-text-in-text-component.md +36 -0
- package/bundled-skills/react-native-skills/rules/scroll-position-no-state.md +82 -0
- package/bundled-skills/react-native-skills/rules/state-ground-truth.md +80 -0
- package/bundled-skills/react-native-skills/rules/ui-expo-image.md +66 -0
- package/bundled-skills/react-native-skills/rules/ui-image-gallery.md +104 -0
- package/bundled-skills/react-native-skills/rules/ui-measure-views.md +78 -0
- package/bundled-skills/react-native-skills/rules/ui-menus.md +174 -0
- package/bundled-skills/react-native-skills/rules/ui-native-modals.md +77 -0
- package/bundled-skills/react-native-skills/rules/ui-pressable.md +61 -0
- package/bundled-skills/react-native-skills/rules/ui-safe-area-scroll.md +65 -0
- package/bundled-skills/react-native-skills/rules/ui-scrollview-content-inset.md +45 -0
- package/bundled-skills/react-native-skills/rules/ui-styling.md +87 -0
- package/bundled-skills/skill-issue/SKILL.md +73 -0
- package/bundled-skills/tdd-workflows/SKILL.md +35 -0
- package/bundled-skills/vercel-cli-with-tokens/SKILL.md +361 -0
- package/bundled-skills/vercel-optimize/CONTRIBUTING.md +41 -0
- package/bundled-skills/vercel-optimize/SKILL.md +331 -0
- package/bundled-skills/vercel-optimize/lib/auth-route.mjs +23 -0
- package/bundled-skills/vercel-optimize/lib/budget-summary.mjs +182 -0
- package/bundled-skills/vercel-optimize/lib/citations.mjs +139 -0
- package/bundled-skills/vercel-optimize/lib/cost-coverage.mjs +143 -0
- package/bundled-skills/vercel-optimize/lib/dedup-recs.mjs +325 -0
- package/bundled-skills/vercel-optimize/lib/deep-dive.mjs +350 -0
- package/bundled-skills/vercel-optimize/lib/display-labels.mjs +185 -0
- package/bundled-skills/vercel-optimize/lib/extract-claims.mjs +550 -0
- package/bundled-skills/vercel-optimize/lib/framework-support.mjs +67 -0
- package/bundled-skills/vercel-optimize/lib/gates/build-minutes-fanout.mjs +69 -0
- package/bundled-skills/vercel-optimize/lib/gates/cold-start.mjs +66 -0
- package/bundled-skills/vercel-optimize/lib/gates/contract.mjs +79 -0
- package/bundled-skills/vercel-optimize/lib/gates/cwv-poor.mjs +87 -0
- package/bundled-skills/vercel-optimize/lib/gates/external-api-slow.mjs +55 -0
- package/bundled-skills/vercel-optimize/lib/gates/hard-gates.mjs +73 -0
- package/bundled-skills/vercel-optimize/lib/gates/index.mjs +45 -0
- package/bundled-skills/vercel-optimize/lib/gates/isr-overrevalidation.mjs +62 -0
- package/bundled-skills/vercel-optimize/lib/gates/middleware-heavy.mjs +51 -0
- package/bundled-skills/vercel-optimize/lib/gates/observability-events-attribution.mjs +56 -0
- package/bundled-skills/vercel-optimize/lib/gates/platform-bot-protection.mjs +115 -0
- package/bundled-skills/vercel-optimize/lib/gates/platform-fluid-compute.mjs +83 -0
- package/bundled-skills/vercel-optimize/lib/gates/region-misconfig.mjs +64 -0
- package/bundled-skills/vercel-optimize/lib/gates/route-errors.mjs +80 -0
- package/bundled-skills/vercel-optimize/lib/gates/scanner-driven.mjs +122 -0
- package/bundled-skills/vercel-optimize/lib/gates/select-candidates.mjs +134 -0
- package/bundled-skills/vercel-optimize/lib/gates/slow-route.mjs +88 -0
- package/bundled-skills/vercel-optimize/lib/gates/types.d.ts +38 -0
- package/bundled-skills/vercel-optimize/lib/gates/uncached-route.mjs +93 -0
- package/bundled-skills/vercel-optimize/lib/gates/usage-spike-triage.mjs +121 -0
- package/bundled-skills/vercel-optimize/lib/grade-recommendation.mjs +155 -0
- package/bundled-skills/vercel-optimize/lib/impact-label.mjs +126 -0
- package/bundled-skills/vercel-optimize/lib/impact-magnitude.mjs +60 -0
- package/bundled-skills/vercel-optimize/lib/investigation-brief.mjs +610 -0
- package/bundled-skills/vercel-optimize/lib/observation-safety.mjs +174 -0
- package/bundled-skills/vercel-optimize/lib/project-facts.mjs +99 -0
- package/bundled-skills/vercel-optimize/lib/queries.mjs +315 -0
- package/bundled-skills/vercel-optimize/lib/reconcile-candidates.mjs +372 -0
- package/bundled-skills/vercel-optimize/lib/render-report.mjs +955 -0
- package/bundled-skills/vercel-optimize/lib/repo-root.mjs +86 -0
- package/bundled-skills/vercel-optimize/lib/route-normalize.mjs +220 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/bot-protection-certainty.mjs +38 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/cache-tag-invalidation-certainty.mjs +30 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/count-correct.mjs +52 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/function-duration-invocations.mjs +38 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/index.mjs +79 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/middleware-conflict.mjs +36 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/missing-citation.mjs +16 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/pre-release.mjs +74 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/rate-limit.mjs +67 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/rendering-mode-mislabel.mjs +38 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/undeclared-dep.mjs +78 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/vercel-directive-strip.mjs +37 -0
- package/bundled-skills/vercel-optimize/lib/sanitizers/window-units.mjs +32 -0
- package/bundled-skills/vercel-optimize/lib/scanners/cache-components-suspense-dedupe.mjs +109 -0
- package/bundled-skills/vercel-optimize/lib/scanners/edge-heavy-import.mjs +94 -0
- package/bundled-skills/vercel-optimize/lib/scanners/force-dynamic.mjs +42 -0
- package/bundled-skills/vercel-optimize/lib/scanners/headers-in-page.mjs +44 -0
- package/bundled-skills/vercel-optimize/lib/scanners/index.mjs +35 -0
- package/bundled-skills/vercel-optimize/lib/scanners/large-static-asset.mjs +92 -0
- package/bundled-skills/vercel-optimize/lib/scanners/max-age-without-s-maxage.mjs +42 -0
- package/bundled-skills/vercel-optimize/lib/scanners/middleware-broad-matcher.mjs +55 -0
- package/bundled-skills/vercel-optimize/lib/scanners/missing-cache-headers.mjs +90 -0
- package/bundled-skills/vercel-optimize/lib/scanners/prisma-include-tree.mjs +42 -0
- package/bundled-skills/vercel-optimize/lib/scanners/region-pin-in-config.mjs +88 -0
- package/bundled-skills/vercel-optimize/lib/scanners/source-maps-production.mjs +36 -0
- package/bundled-skills/vercel-optimize/lib/scanners/sveltekit-prerender-missing.mjs +43 -0
- package/bundled-skills/vercel-optimize/lib/scanners/turbo-force-bypass.mjs +129 -0
- package/bundled-skills/vercel-optimize/lib/scanners/unoptimized-image.mjs +113 -0
- package/bundled-skills/vercel-optimize/lib/scanners/use-cache-date-stamp.mjs +106 -0
- package/bundled-skills/vercel-optimize/lib/support-topics.mjs +355 -0
- package/bundled-skills/vercel-optimize/lib/throttle.mjs +273 -0
- package/bundled-skills/vercel-optimize/lib/util.mjs +17 -0
- package/bundled-skills/vercel-optimize/lib/vercel.mjs +784 -0
- package/bundled-skills/vercel-optimize/lib/verify-claim.mjs +1296 -0
- package/bundled-skills/vercel-optimize/lib/workspace-resolver.mjs +521 -0
- package/bundled-skills/vercel-optimize/references/candidates.md +176 -0
- package/bundled-skills/vercel-optimize/references/data-collection.md +218 -0
- package/bundled-skills/vercel-optimize/references/docs-library.json +683 -0
- package/bundled-skills/vercel-optimize/references/doctrine.md +105 -0
- package/bundled-skills/vercel-optimize/references/observability-plus.md +108 -0
- package/bundled-skills/vercel-optimize/references/playbooks/README.md +53 -0
- package/bundled-skills/vercel-optimize/references/playbooks/ai-application.md +32 -0
- package/bundled-skills/vercel-optimize/references/playbooks/api-service.md +30 -0
- package/bundled-skills/vercel-optimize/references/playbooks/content-site.md +30 -0
- package/bundled-skills/vercel-optimize/references/playbooks/ecommerce.md +30 -0
- package/bundled-skills/vercel-optimize/references/playbooks/marketing.md +30 -0
- package/bundled-skills/vercel-optimize/references/playbooks/saas.md +31 -0
- package/bundled-skills/vercel-optimize/references/playbooks/sveltekit.md +75 -0
- package/bundled-skills/vercel-optimize/references/recommendations.md +203 -0
- package/bundled-skills/vercel-optimize/references/scanner-patterns.md +251 -0
- package/bundled-skills/vercel-optimize/references/scoring.md +205 -0
- package/bundled-skills/vercel-optimize/references/support-topics/README.md +46 -0
- package/bundled-skills/vercel-optimize/references/support-topics/astro-edge-middleware-scope.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/astro-output-mode-and-isr.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/auth-preserving-parallelization.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/bot-protection-product-guardrails.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/build-minutes-monorepo-fanout.md +23 -0
- package/bundled-skills/vercel-optimize/references/support-topics/cache-components-static-shell-boundaries.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/cache-components-suspense-dedupe-pitfall.md +23 -0
- package/bundled-skills/vercel-optimize/references/support-topics/cdn-cache-auth-safety.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/cold-start-initialization-bundle.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/core-web-vitals-client-bottlenecks.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/database-egress-pooling-region.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/dynamic-rendering-traps.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/external-api-critical-path-platform.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/external-api-critical-path.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/fast-data-transfer-payloads.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/fluid-compute-caveats.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/function-duration-io-and-after.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/function-invocation-reduction.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/function-region-misconfiguration-ttfb.md +23 -0
- package/bundled-skills/vercel-optimize/references/support-topics/image-optimization-cost-control.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/isr-revalidation-static-generation.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/middleware-proxy-edge-cost.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/next-fetch-revalidate-floor.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/next-font-cls-self-hosting.md +23 -0
- package/bundled-skills/vercel-optimize/references/support-topics/next-heavy-ui-lazy-load-boundaries.md +23 -0
- package/bundled-skills/vercel-optimize/references/support-topics/next-image-lcp-preload-sizes.md +23 -0
- package/bundled-skills/vercel-optimize/references/support-topics/next-route-handler-get-cache-defaults.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/next-script-third-party-strategy.md +23 -0
- package/bundled-skills/vercel-optimize/references/support-topics/nextjs-version-cache-semantics.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/not-found-catchall-request-waste.md +23 -0
- package/bundled-skills/vercel-optimize/references/support-topics/nuxt-route-rules-cache-isr.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/observability-events-cost-attribution.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/post-response-work-waituntil.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/route-error-durable-offload.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/route-error-runtime-limits.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/runtime-cache-reusable-data.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/sveltekit-isr-prerender-safety.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/sveltekit-split-cold-start-tradeoff.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/usage-spike-triage.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/use-cache-date-stamp-isr-write-amplifier.md +23 -0
- package/bundled-skills/vercel-optimize/references/support-topics/use-cache-remote-shared-origin-data.md +22 -0
- package/bundled-skills/vercel-optimize/references/support-topics/workflow-resumable-stream-routes.md +23 -0
- package/bundled-skills/vercel-optimize/references/verification.md +102 -0
- package/bundled-skills/vercel-optimize/references/voice.md +76 -0
- package/bundled-skills/vercel-optimize/scripts/budget-summary.mjs +56 -0
- package/bundled-skills/vercel-optimize/scripts/build-docs.mjs +74 -0
- package/bundled-skills/vercel-optimize/scripts/check-citations.mjs +81 -0
- package/bundled-skills/vercel-optimize/scripts/check-docs-fresh.mjs +93 -0
- package/bundled-skills/vercel-optimize/scripts/collect-signals.mjs +576 -0
- package/bundled-skills/vercel-optimize/scripts/collect-sub-agent-outputs.mjs +296 -0
- package/bundled-skills/vercel-optimize/scripts/deep-dive.mjs +319 -0
- package/bundled-skills/vercel-optimize/scripts/gate-investigations.mjs +166 -0
- package/bundled-skills/vercel-optimize/scripts/merge-signals.mjs +192 -0
- package/bundled-skills/vercel-optimize/scripts/prepare-investigation-brief.mjs +231 -0
- package/bundled-skills/vercel-optimize/scripts/reconcile-candidates.mjs +62 -0
- package/bundled-skills/vercel-optimize/scripts/render-report.mjs +437 -0
- package/bundled-skills/vercel-optimize/scripts/scan-codebase.mjs +313 -0
- package/bundled-skills/vercel-optimize/scripts/verify-and-regen.mjs +346 -0
- package/bundled-skills/vercel-optimize/scripts/verify-finding.mjs +19 -0
- package/bundled-skills/vercel-react-view-transitions/SKILL.md +327 -0
- package/bundled-skills/vercel-react-view-transitions/references/css-recipes.md +242 -0
- package/bundled-skills/vercel-react-view-transitions/references/implementation.md +182 -0
- package/bundled-skills/vercel-react-view-transitions/references/nextjs.md +176 -0
- package/bundled-skills/vercel-react-view-transitions/references/patterns.md +262 -0
- package/package.json +2 -2
- package/skills_index.json +312 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vercel-react-view-transitions
|
|
3
|
+
description: "Guide React and Next.js view transitions, shared element animations, route transitions, transition types, and reduced-motion-safe UI state animation."
|
|
4
|
+
risk: safe
|
|
5
|
+
source: "https://github.com/vercel-labs/agent-skills"
|
|
6
|
+
date_added: "2026-06-02"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# React View Transitions
|
|
10
|
+
|
|
11
|
+
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.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
- Use this skill when the task matches this description: Guide React and Next.js view transitions, shared element animations, route transitions, transition types, and reduced-motion-safe UI state animation.
|
|
15
|
+
|
|
16
|
+
## When to Animate
|
|
17
|
+
|
|
18
|
+
Every `<ViewTransition>` should communicate a spatial relationship or continuity. If you can't articulate what it communicates, don't add it.
|
|
19
|
+
|
|
20
|
+
Implement **all** applicable patterns from this list, in this order:
|
|
21
|
+
|
|
22
|
+
| Priority | Pattern | What it communicates |
|
|
23
|
+
|----------|---------|---------------------|
|
|
24
|
+
| 1 | **Shared element** (`name`) | "Same thing — going deeper" |
|
|
25
|
+
| 2 | **Suspense reveal** | "Data loaded" |
|
|
26
|
+
| 3 | **List identity** (per-item `key`) | "Same items, new arrangement" |
|
|
27
|
+
| 4 | **State change** (`enter`/`exit`) | "Something appeared/disappeared" |
|
|
28
|
+
| 5 | **Route change** (layout-level) | "Going to a new place" |
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
### Choosing Animation Style
|
|
33
|
+
|
|
34
|
+
| Context | Animation | Why |
|
|
35
|
+
|---------|-----------|-----|
|
|
36
|
+
| Hierarchical navigation (list → detail) | Type-keyed `nav-forward` / `nav-back` | Communicates spatial depth |
|
|
37
|
+
| Lateral navigation (tab-to-tab) | Bare `<ViewTransition>` (fade) or `default="none"` | No depth to communicate |
|
|
38
|
+
| Suspense reveal | `enter`/`exit` string props | Content arriving |
|
|
39
|
+
| Revalidation / background refresh | `default="none"` | Silent — no animation needed |
|
|
40
|
+
|
|
41
|
+
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.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Availability
|
|
46
|
+
|
|
47
|
+
- **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.
|
|
48
|
+
- **Without Next.js:** Install `react@canary react-dom@canary` (`ViewTransition` is not in stable React).
|
|
49
|
+
- Browser support: Chromium 111+, Firefox 144+, Safari 18.2+. Graceful degradation on unsupported browsers.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Implementation Workflow
|
|
54
|
+
|
|
55
|
+
When adding view transitions to an existing app, **follow `references/implementation.md` step by step.** Start with the audit — do not skip it. Copy the CSS recipes from `references/css-recipes.md` into the global stylesheet — do not write your own animation CSS.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Core Concepts
|
|
60
|
+
|
|
61
|
+
### The `<ViewTransition>` Component
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
import { ViewTransition } from 'react';
|
|
65
|
+
|
|
66
|
+
<ViewTransition>
|
|
67
|
+
<Component />
|
|
68
|
+
</ViewTransition>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
React auto-assigns a unique `view-transition-name` and calls `document.startViewTransition` behind the scenes. Never call `startViewTransition` yourself.
|
|
72
|
+
|
|
73
|
+
### Animation Triggers
|
|
74
|
+
|
|
75
|
+
| Trigger | When it fires |
|
|
76
|
+
|---------|--------------|
|
|
77
|
+
| **enter** | `<ViewTransition>` first inserted during a Transition |
|
|
78
|
+
| **exit** | `<ViewTransition>` first removed during a Transition |
|
|
79
|
+
| **update** | DOM mutations inside a `<ViewTransition>`. With nested VTs, mutation applies to the innermost one |
|
|
80
|
+
| **share** | Named VT unmounts and another with same `name` mounts in the same Transition |
|
|
81
|
+
|
|
82
|
+
Only `startTransition`, `useDeferredValue`, or `Suspense` activate VTs. Regular `setState` does not animate.
|
|
83
|
+
|
|
84
|
+
### Critical Placement Rule
|
|
85
|
+
|
|
86
|
+
`<ViewTransition>` only activates enter/exit if it appears **before any DOM nodes**:
|
|
87
|
+
|
|
88
|
+
```jsx
|
|
89
|
+
// Works
|
|
90
|
+
<ViewTransition enter="auto" exit="auto">
|
|
91
|
+
<div>Content</div>
|
|
92
|
+
</ViewTransition>
|
|
93
|
+
|
|
94
|
+
// Broken — div wraps the VT, suppressing enter/exit
|
|
95
|
+
<div>
|
|
96
|
+
<ViewTransition enter="auto" exit="auto">
|
|
97
|
+
<div>Content</div>
|
|
98
|
+
</ViewTransition>
|
|
99
|
+
</div>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Styling with View Transition Classes
|
|
105
|
+
|
|
106
|
+
### Props
|
|
107
|
+
|
|
108
|
+
Values: `"auto"` (browser cross-fade), `"none"` (disabled), `"class-name"` (custom CSS), or `{ [type]: value }` for type-specific animations.
|
|
109
|
+
|
|
110
|
+
```jsx
|
|
111
|
+
<ViewTransition default="none" enter="slide-in" exit="slide-out" share="morph" />
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
If `default` is `"none"`, all triggers are off unless explicitly listed.
|
|
115
|
+
|
|
116
|
+
### CSS Pseudo-Elements
|
|
117
|
+
|
|
118
|
+
- `::view-transition-old(.class)` — outgoing snapshot
|
|
119
|
+
- `::view-transition-new(.class)` — incoming snapshot
|
|
120
|
+
- `::view-transition-group(.class)` — container
|
|
121
|
+
- `::view-transition-image-pair(.class)` — old + new pair
|
|
122
|
+
|
|
123
|
+
See `references/css-recipes.md` for ready-to-use animation recipes.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Transition Types
|
|
128
|
+
|
|
129
|
+
Tag transitions with `addTransitionType` so VTs can pick different animations based on context. Call it multiple times to stack types — different VTs in the tree react to different types:
|
|
130
|
+
|
|
131
|
+
```jsx
|
|
132
|
+
startTransition(() => {
|
|
133
|
+
addTransitionType('nav-forward');
|
|
134
|
+
addTransitionType('select-item');
|
|
135
|
+
router.push('/detail/1');
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Pass an object to map types to CSS classes. Works on `enter`, `exit`, **and** `share`:
|
|
140
|
+
|
|
141
|
+
```jsx
|
|
142
|
+
<ViewTransition
|
|
143
|
+
enter={{ 'nav-forward': 'slide-from-right', 'nav-back': 'slide-from-left', default: 'none' }}
|
|
144
|
+
exit={{ 'nav-forward': 'slide-to-left', 'nav-back': 'slide-to-right', default: 'none' }}
|
|
145
|
+
share={{ 'nav-forward': 'morph-forward', 'nav-back': 'morph-back', default: 'morph' }}
|
|
146
|
+
default="none"
|
|
147
|
+
>
|
|
148
|
+
<Page />
|
|
149
|
+
</ViewTransition>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
`enter` and `exit` don't have to be symmetric. For example, fade in but slide out directionally:
|
|
153
|
+
|
|
154
|
+
```jsx
|
|
155
|
+
<ViewTransition
|
|
156
|
+
enter={{ 'nav-forward': 'fade-in', 'nav-back': 'fade-in', default: 'none' }}
|
|
157
|
+
exit={{ 'nav-forward': 'nav-forward', 'nav-back': 'nav-back', default: 'none' }}
|
|
158
|
+
default="none"
|
|
159
|
+
>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**TypeScript:** `ViewTransitionClassPerType` requires a `default` key in the object.
|
|
163
|
+
|
|
164
|
+
For apps with multiple pages, extract the type-keyed VT into a reusable wrapper:
|
|
165
|
+
|
|
166
|
+
```jsx
|
|
167
|
+
export function DirectionalTransition({ children }: { children: React.ReactNode }) {
|
|
168
|
+
return (
|
|
169
|
+
<ViewTransition
|
|
170
|
+
enter={{ 'nav-forward': 'nav-forward', 'nav-back': 'nav-back', default: 'none' }}
|
|
171
|
+
exit={{ 'nav-forward': 'nav-forward', 'nav-back': 'nav-back', default: 'none' }}
|
|
172
|
+
default="none"
|
|
173
|
+
>
|
|
174
|
+
{children}
|
|
175
|
+
</ViewTransition>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### `router.back()` and Browser Back Button
|
|
181
|
+
|
|
182
|
+
`router.back()` and the browser's back/forward buttons do **not** trigger view transitions (`popstate` is synchronous, incompatible with `startViewTransition`). Use `router.push()` with an explicit URL instead.
|
|
183
|
+
|
|
184
|
+
### Types and Suspense
|
|
185
|
+
|
|
186
|
+
Types are available during navigation but **not** during subsequent Suspense reveals (separate transitions, no type). Use type maps for page-level enter/exit; use simple string props for Suspense reveals.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Shared Element Transitions
|
|
191
|
+
|
|
192
|
+
Same `name` on two VTs — one unmounting, one mounting — creates a shared element morph:
|
|
193
|
+
|
|
194
|
+
```jsx
|
|
195
|
+
<ViewTransition name="hero-image">
|
|
196
|
+
<img src="/thumb.jpg" onClick={() => startTransition(() => onSelect())} />
|
|
197
|
+
</ViewTransition>
|
|
198
|
+
|
|
199
|
+
// On the other view — same name
|
|
200
|
+
<ViewTransition name="hero-image">
|
|
201
|
+
<img src="/full.jpg" />
|
|
202
|
+
</ViewTransition>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
- Only one VT with a given `name` can be mounted at a time — use unique names (`photo-${id}`). Watch for reusable components: if a component with a named VT is rendered in both a modal/popover *and* a page, both mount simultaneously and break the morph. Either make the name conditional (via a prop) or move the named VT out of the shared component into the specific consumer.
|
|
206
|
+
- `share` takes precedence over `enter`/`exit`. Think through each navigation path: when no matching pair forms (e.g., the target page doesn't have the same name), `enter`/`exit` fires instead. Consider whether the element needs a fallback animation for those paths.
|
|
207
|
+
- Never use a fade-out exit on pages with shared morphs — use a directional slide instead.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Common Patterns
|
|
212
|
+
|
|
213
|
+
### Enter/Exit
|
|
214
|
+
|
|
215
|
+
```jsx
|
|
216
|
+
{show && (
|
|
217
|
+
<ViewTransition enter="fade-in" exit="fade-out"><Panel /></ViewTransition>
|
|
218
|
+
)}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### List Reorder
|
|
222
|
+
|
|
223
|
+
```jsx
|
|
224
|
+
{items.map(item => (
|
|
225
|
+
<ViewTransition key={item.id}><ItemCard item={item} /></ViewTransition>
|
|
226
|
+
))}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Trigger inside `startTransition`. Avoid wrapper `<div>`s between list and VT.
|
|
230
|
+
|
|
231
|
+
### Composing Shared Elements with List Identity
|
|
232
|
+
|
|
233
|
+
Shared elements and list identity are independent concerns — don't confuse one for the other. When a list item contains a shared element (e.g., an image that morphs into a detail view), use two nested `<ViewTransition>` boundaries:
|
|
234
|
+
|
|
235
|
+
```jsx
|
|
236
|
+
{items.map(item => (
|
|
237
|
+
<ViewTransition key={item.id}> {/* list identity */}
|
|
238
|
+
<Link href={`/items/${item.id}`}>
|
|
239
|
+
<ViewTransition name={`item-image-${item.id}`} share="morph"> {/* shared element */}
|
|
240
|
+
<Image src={item.image} />
|
|
241
|
+
</ViewTransition>
|
|
242
|
+
<p>{item.name}</p>
|
|
243
|
+
</Link>
|
|
244
|
+
</ViewTransition>
|
|
245
|
+
))}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
The outer VT handles list reorder/enter animations. The inner VT handles the cross-route shared element morph. Missing either layer means that animation silently doesn't happen.
|
|
249
|
+
|
|
250
|
+
### Force Re-Enter with `key`
|
|
251
|
+
|
|
252
|
+
```jsx
|
|
253
|
+
<ViewTransition key={searchParams.toString()} enter="slide-up" default="none">
|
|
254
|
+
<ResultsGrid />
|
|
255
|
+
</ViewTransition>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Caution:** If wrapping `<Suspense>`, changing `key` remounts the boundary and refetches.
|
|
259
|
+
|
|
260
|
+
### Suspense Fallback to Content
|
|
261
|
+
|
|
262
|
+
Simple cross-fade:
|
|
263
|
+
```jsx
|
|
264
|
+
<ViewTransition>
|
|
265
|
+
<Suspense fallback={<Skeleton />}><Content /></Suspense>
|
|
266
|
+
</ViewTransition>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Directional reveal:
|
|
270
|
+
```jsx
|
|
271
|
+
<Suspense fallback={<ViewTransition exit="slide-down"><Skeleton /></ViewTransition>}>
|
|
272
|
+
<ViewTransition enter="slide-up" default="none"><Content /></ViewTransition>
|
|
273
|
+
</Suspense>
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
For more patterns, see `references/patterns.md`.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## How Multiple VTs Interact
|
|
281
|
+
|
|
282
|
+
Every VT matching the trigger fires simultaneously in a single `document.startViewTransition`. VTs in **different** transitions (navigation vs later Suspense resolve) don't compete.
|
|
283
|
+
|
|
284
|
+
### Use `default="none"` Liberally
|
|
285
|
+
|
|
286
|
+
Without it, every VT fires the browser cross-fade on **every** transition — Suspense resolves, `useDeferredValue` updates, background revalidations. Always use `default="none"` and explicitly enable only desired triggers.
|
|
287
|
+
|
|
288
|
+
### Two Patterns Coexist
|
|
289
|
+
|
|
290
|
+
**Pattern A — Directional slides:** Type-keyed VT on each page, fires during navigation.
|
|
291
|
+
**Pattern B — Suspense reveals:** Simple string props, fires when data loads (no type).
|
|
292
|
+
|
|
293
|
+
They coexist because they fire at different moments. `default="none"` on both prevents cross-interference. Always pair `enter` with `exit`. Place directional VTs in page components, not layouts.
|
|
294
|
+
|
|
295
|
+
### Nested VT Limitation
|
|
296
|
+
|
|
297
|
+
When a parent VT exits, nested VTs inside it do **not** fire their own enter/exit — only the outermost VT animates. Per-item staggered animations during page navigation are not possible today. See [react#36135](https://github.com/facebook/react/pull/36135) for an experimental opt-in fix.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Next.js Integration
|
|
302
|
+
|
|
303
|
+
For Next.js setup (`experimental.viewTransition` flag, `transitionTypes` prop on `next/link`, App Router patterns, Server Components), see `references/nextjs.md`.
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Accessibility
|
|
308
|
+
|
|
309
|
+
Always add the reduced motion CSS from `references/css-recipes.md` to your global stylesheet.
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Reference Files
|
|
314
|
+
|
|
315
|
+
- **`references/implementation.md`** — Step-by-step implementation workflow.
|
|
316
|
+
- **`references/patterns.md`** — Patterns, animation timing, events API, troubleshooting.
|
|
317
|
+
- **`references/css-recipes.md`** — Ready-to-use CSS animation recipes.
|
|
318
|
+
- **`references/nextjs.md`** — Next.js App Router patterns and Server Component details.
|
|
319
|
+
|
|
320
|
+
## Full Compiled Document
|
|
321
|
+
|
|
322
|
+
For the complete guide with all reference files expanded: `AGENTS.md`
|
|
323
|
+
|
|
324
|
+
## Limitations
|
|
325
|
+
- Use this skill only when the task clearly matches the scope described above.
|
|
326
|
+
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
|
|
327
|
+
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# CSS Animation Recipes
|
|
2
|
+
|
|
3
|
+
Ready-to-use CSS for `<ViewTransition>` props. Copy into your global stylesheet.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Timing Variables
|
|
8
|
+
|
|
9
|
+
```css
|
|
10
|
+
:root {
|
|
11
|
+
--duration-exit: 150ms;
|
|
12
|
+
--duration-enter: 210ms;
|
|
13
|
+
--duration-move: 400ms;
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Shared Keyframes
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
@keyframes fade {
|
|
21
|
+
from { filter: blur(3px); opacity: 0; }
|
|
22
|
+
to { filter: blur(0); opacity: 1; }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@keyframes slide {
|
|
26
|
+
from { translate: var(--slide-offset); }
|
|
27
|
+
to { translate: 0; }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@keyframes slide-y {
|
|
31
|
+
from { transform: translateY(var(--slide-y-offset, 10px)); }
|
|
32
|
+
to { transform: translateY(0); }
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Fade
|
|
39
|
+
|
|
40
|
+
```css
|
|
41
|
+
::view-transition-old(.fade-out) {
|
|
42
|
+
animation: var(--duration-exit) ease-in fade reverse;
|
|
43
|
+
}
|
|
44
|
+
::view-transition-new(.fade-in) {
|
|
45
|
+
animation: var(--duration-enter) ease-out var(--duration-exit) both fade;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Usage: `<ViewTransition enter="fade-in" exit="fade-out" />`
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Slide (Vertical)
|
|
54
|
+
|
|
55
|
+
```css
|
|
56
|
+
::view-transition-old(.slide-down) {
|
|
57
|
+
animation:
|
|
58
|
+
var(--duration-exit) ease-out both fade reverse,
|
|
59
|
+
var(--duration-exit) ease-out both slide-y reverse;
|
|
60
|
+
}
|
|
61
|
+
::view-transition-new(.slide-up) {
|
|
62
|
+
animation:
|
|
63
|
+
var(--duration-enter) ease-in var(--duration-exit) both fade,
|
|
64
|
+
var(--duration-move) ease-in both slide-y;
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Usage:
|
|
69
|
+
```jsx
|
|
70
|
+
<Suspense fallback={<ViewTransition exit="slide-down"><Skeleton /></ViewTransition>}>
|
|
71
|
+
<ViewTransition default="none" enter="slide-up"><Content /></ViewTransition>
|
|
72
|
+
</Suspense>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Directional Navigation
|
|
78
|
+
|
|
79
|
+
### Separate Enter/Exit Classes
|
|
80
|
+
|
|
81
|
+
```css
|
|
82
|
+
::view-transition-new(.slide-from-right) {
|
|
83
|
+
--slide-offset: 60px;
|
|
84
|
+
animation:
|
|
85
|
+
var(--duration-enter) ease-out var(--duration-exit) both fade,
|
|
86
|
+
var(--duration-move) ease-in-out both slide;
|
|
87
|
+
}
|
|
88
|
+
::view-transition-old(.slide-to-left) {
|
|
89
|
+
--slide-offset: -60px;
|
|
90
|
+
animation:
|
|
91
|
+
var(--duration-exit) ease-in both fade reverse,
|
|
92
|
+
var(--duration-move) ease-in-out both slide reverse;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
::view-transition-new(.slide-from-left) {
|
|
96
|
+
--slide-offset: -60px;
|
|
97
|
+
animation:
|
|
98
|
+
var(--duration-enter) ease-out var(--duration-exit) both fade,
|
|
99
|
+
var(--duration-move) ease-in-out both slide;
|
|
100
|
+
}
|
|
101
|
+
::view-transition-old(.slide-to-right) {
|
|
102
|
+
--slide-offset: 60px;
|
|
103
|
+
animation:
|
|
104
|
+
var(--duration-exit) ease-in both fade reverse,
|
|
105
|
+
var(--duration-move) ease-in-out both slide reverse;
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Single-Class Approach
|
|
110
|
+
|
|
111
|
+
```css
|
|
112
|
+
::view-transition-old(.nav-forward) {
|
|
113
|
+
--slide-offset: -60px;
|
|
114
|
+
animation:
|
|
115
|
+
var(--duration-exit) ease-in both fade reverse,
|
|
116
|
+
var(--duration-move) ease-in-out both slide reverse;
|
|
117
|
+
}
|
|
118
|
+
::view-transition-new(.nav-forward) {
|
|
119
|
+
--slide-offset: 60px;
|
|
120
|
+
animation:
|
|
121
|
+
var(--duration-enter) ease-out var(--duration-exit) both fade,
|
|
122
|
+
var(--duration-move) ease-in-out both slide;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
::view-transition-old(.nav-back) {
|
|
126
|
+
--slide-offset: 60px;
|
|
127
|
+
animation:
|
|
128
|
+
var(--duration-exit) ease-in both fade reverse,
|
|
129
|
+
var(--duration-move) ease-in-out both slide reverse;
|
|
130
|
+
}
|
|
131
|
+
::view-transition-new(.nav-back) {
|
|
132
|
+
--slide-offset: -60px;
|
|
133
|
+
animation:
|
|
134
|
+
var(--duration-enter) ease-out var(--duration-exit) both fade,
|
|
135
|
+
var(--duration-move) ease-in-out both slide;
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Shared Element Morph
|
|
142
|
+
|
|
143
|
+
```css
|
|
144
|
+
::view-transition-group(.morph) {
|
|
145
|
+
animation-duration: var(--duration-move);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
::view-transition-image-pair(.morph) {
|
|
149
|
+
animation-name: via-blur;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@keyframes via-blur {
|
|
153
|
+
30% { filter: blur(3px); }
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Usage: `<ViewTransition name={`product-${id}`} share="morph" />`
|
|
158
|
+
|
|
159
|
+
**Note:** Shared element transitions take raster snapshots. For text with significant size differences (e.g., `<h3>` → `<h1>`), the old snapshot gets scaled up, producing a visible ghost artifact. Use `text-morph` for text shared elements.
|
|
160
|
+
|
|
161
|
+
## Text Morph
|
|
162
|
+
|
|
163
|
+
Avoids raster scaling artifacts on text by hiding the old snapshot and showing the new text at full resolution:
|
|
164
|
+
|
|
165
|
+
```css
|
|
166
|
+
::view-transition-group(.text-morph) {
|
|
167
|
+
animation-duration: var(--duration-move);
|
|
168
|
+
}
|
|
169
|
+
::view-transition-old(.text-morph) {
|
|
170
|
+
display: none;
|
|
171
|
+
}
|
|
172
|
+
::view-transition-new(.text-morph) {
|
|
173
|
+
animation: none;
|
|
174
|
+
object-fit: none;
|
|
175
|
+
object-position: left top;
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Usage: `<ViewTransition name={`title-${id}`} share="text-morph" />`
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Scale
|
|
184
|
+
|
|
185
|
+
```css
|
|
186
|
+
::view-transition-old(.scale-out) {
|
|
187
|
+
animation: var(--duration-exit) ease-in scale-down;
|
|
188
|
+
}
|
|
189
|
+
::view-transition-new(.scale-in) {
|
|
190
|
+
animation: var(--duration-enter) ease-out var(--duration-exit) both scale-up;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@keyframes scale-down {
|
|
194
|
+
from { transform: scale(1); opacity: 1; }
|
|
195
|
+
to { transform: scale(0.85); opacity: 0; }
|
|
196
|
+
}
|
|
197
|
+
@keyframes scale-up {
|
|
198
|
+
from { transform: scale(0.85); opacity: 0; }
|
|
199
|
+
to { transform: scale(1); opacity: 1; }
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Usage: `<ViewTransition enter="scale-in" exit="scale-out" />`
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Persistent Element Isolation
|
|
208
|
+
|
|
209
|
+
```css
|
|
210
|
+
::view-transition-group(persistent-nav) {
|
|
211
|
+
animation: none;
|
|
212
|
+
z-index: 100;
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Backdrop-Blur Workaround
|
|
217
|
+
|
|
218
|
+
For elements with `backdrop-filter`, hide the old snapshot to avoid flash:
|
|
219
|
+
|
|
220
|
+
```css
|
|
221
|
+
::view-transition-old(persistent-nav) {
|
|
222
|
+
display: none;
|
|
223
|
+
}
|
|
224
|
+
::view-transition-new(persistent-nav) {
|
|
225
|
+
animation: none;
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Reduced Motion
|
|
232
|
+
|
|
233
|
+
```css
|
|
234
|
+
@media (prefers-reduced-motion: reduce) {
|
|
235
|
+
::view-transition-old(*),
|
|
236
|
+
::view-transition-new(*),
|
|
237
|
+
::view-transition-group(*) {
|
|
238
|
+
animation-duration: 0s !important;
|
|
239
|
+
animation-delay: 0s !important;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
```
|