Nuxt/docs/content/3.api/2.components/4.nuxt-loading-indicator.md
Daniil Chudo 75f4a54f7e
feat(nuxt): add default slot to <NuxtLoadingIndicator> (#7128)
Co-authored-by: Alexander Lichter <github@lichter.io>
2022-10-10 11:12:36 +01:00

36 lines
1.1 KiB
Markdown

# `<NuxtLoadingIndicator>`
The `<NuxtLoadingIndicator>` component displays a progress bar on page navigation.
## Examples
### Basic Usage
Add `<NuxtLoadingIndicator/>` in your `app.vue` or layouts.
```vue [app.vue]
<template>
<NuxtLayout>
<NuxtLoadingIndicator /> <!-- here -->
<NuxtPage />
</NuxtLayout>
</template>
```
:button-link[Open on StackBlitz]{href="https://stackblitz.com/github/nuxt/framework/tree/main/examples/routing/pages?terminal=dev&file=/app.vue" blank}
## Slots
You can pass custom HTML or components through the loading indicator's default slot.
## Props
- **color**: The color of the loading bar.
- **height**: Height of the loading bar, in pixels (default `3`).
- **duration**: Duration of the loading bar, in milliseconds (default `2000`).
- **throttle**: Throttle the appearing and hiding, in milliseconds (default `200`).
::alert{type=info icon=🔎}
This component is completely optional. To achieve full customization, you can implement your own one based on [this file](https://github.com/nuxt/framework/blob/main/packages/nuxt/src/app/components/nuxt-loading-indicator.ts).
::