But it only has a predefined UI and can only be customized using these attributes
Color: The color of the loading bar.
Height: Height of the loading bar in pixels (default is 3).
Duration: The duration of the loading bar in milliseconds (default is 2000).
Limit: Limit showing and hiding in milliseconds (default 200).
Customizable loader
If you need a custom loader (such as a full screen spinner with a background), a different approach is required. This approach allows you to create any loader and display it when needed.
Nuxt3 provides application runtime hooks with interceptors for page:start and page:finish events. To use them correctly you need to use these hooks (in app.vue or your custom component) this way:
Based on this article. There is a simple but limited solution and a fully customized solution.
built-in
Contains a loading progress bar that can be used like thisBut it only has a predefined UI and can only be customized using these attributes
Customizable loader
If you need a custom loader (such as a full screen spinner with a background), a different approach is required. This approach allows you to create any loader and display it when needed.
Nuxt3 provides application runtime hooks with interceptors for
page:start
andpage:finish
events. To use them correctly you need to use these hooks (in app.vue or your custom component) this way: