nuxt/nuxt

[Feature Request] Use the new browser Navigation API to show a native loading indicator when navigating

Open

#24553 opened on Dec 1, 2023

View on GitHub
 (6 comments) (12 reactions) (0 assignees)TypeScript (60,221 stars) (5,607 forks)batch import
good first issueupstream🍰 p2-nice-to-have

Description

Describe the feature

There is a new Navigation API for browsers which can trigger native browser loading indicator when navigating between SPA pages. This adds a nice native feel for SPA navigation. Currently Nuxt has the <NuxtLoadingIndicator /> component that shows the loading bar at the top but I think if we combine that with this native loading indicator feature we can really make great UX.

Yes, this is bleeding edge feature not currently supported everywhere but I think it would be nice to still give users the option to use this new feature IF their browser supports it.

Docs: https://developer.chrome.com/docs/web-platform/navigation-api/ https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API

Demo: https://gigantic-honored-octagon.glitch.me/

(In the demo, you can activate the Add an artificial two-second delay to all navigations (should impact the loading spinner/scroll restoration/focus reset/accessibility announcements). checkbox to see the native loader appearing on the tab when navigating)

image

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

Contributor guide