Skip to content

feat: View Transitions for AppShell and collapsible side nav #334

Closed

Description

@cixzhang

Context

React 19 ships native support for the View Transitions API via <ViewTransition> and useViewTransition. Now that we're on React 19, we can leverage this for smooth, browser-native animations in layout-level components.

Two high-value targets:

1. AppShell — side nav collapse/expand

XDSAppShell manages a collapsible side nav panel (XDSLayoutPanel) that currently snaps between expanded and collapsed states. Wrapping this in a view transition would give us smooth width + content crossfade animations without manual CSS transition management.

Opportunities:

  • Animate panel width changes when toggling the side nav
  • Crossfade between full nav labels and icon-only collapsed state
  • Animate the main content area reflow as the panel resizes
  • Respect prefers-reduced-motion automatically (view transitions honor this)

2. XDSCollapsible — expand/collapse content

XDSCollapsible currently uses CSS transitions on the chevron but the content area appearance is abrupt. View transitions could provide:

  • Smooth height animation for content reveal/hide
  • Crossfade for content entering/leaving
  • Coordinated animation when used inside XDSCollapsibleGroup (accordion mode — one closing while another opens)

Approach

  • Use React 19's <ViewTransition> component and useViewTransition hook
  • Assign view-transition-name via StyleX for the animating elements
  • Keep CSS transition fallbacks for browsers without View Transitions support
  • Follow the same progressive enhancement pattern — works without JS animations, enhanced with them

References

Activity

  1. added
    enhancement
    on Feb 25, 2026
  2. cixzhang commented on Sep 2, 2026

    @cixzhang
    ContributorAuthor

    Thank you for opening this - it framed a lot of the shell-motion work that followed. Closing it as superseded rather than rejected: the auto-height disclosure half is now tracked in #4882, which carries the up-to-date browser-support and React-availability picture, and the AppShell nav half is tracked in #4255, where the chosen mechanism is a mounted-but-hidden region plus token-based CSS motion rather than view transitions. Nothing in main uses React's <ViewTransition> today and the motion guidance in docs/design/motion.md is still a draft, so there is no decision recorded here that those two issues do not already hold. Please reopen if view transitions for the shell need a thread of their own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions