Skip to content

[Component/React] Implement useViewTransition hook for native page-to-page morphing #48638

Description

@Viidhii19

Problem / Motivation

Smoothly transitioning between different views or routes in React typically requires heavy routing animation libraries. The modern web platform recently introduced the native document.startViewTransition() API, which allows the browser to take a screenshot of the old DOM and smoothly morph it into the new DOM.

Proposed Solution

Build a lightweight React hook (useViewTransition) that wraps state updates in the native View Transitions API, injecting EaseMotion's timing and easing variables to control the morph duration.

Implementation Details

As per the strict contribution guidelines, I will isolate this in the React track:

  1. Create submissions/react/ease-view-transition-viidhii19/.
  2. Build useViewTransition.jsx. It will export a function that takes an update callback (e.g., a React state setter). If the browser supports startViewTransition, it yields to the API; otherwise, it degrades gracefully to standard rendering.
  3. Build style.css defining the ::view-transition-old and ::view-transition-new pseudo-elements, mapping their durations directly to EaseMotion CSS variables like var(--ease-speed-medium).
  4. Provide demo.html showing a list view seamlessly morphing into a detail view without external routing libraries.

Track

React Integration (submissions/react/)

Would you like to work on this?

  • Yes, I'll build this cutting-edge View Transitions hook! (GSSoC '26 Contributor)

Metadata

Metadata

Labels

GSSoC-26Official GSSoC 2026 issueacceptedContribution approved for integration into EaseMotion CSSanimationAnimation effects, hover interactions, motion ideas, transitionsgood first issueGood for newcomershelp wantedExtra attention neededlevel:intermediateRequires moderate project understanding

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions