# Loading Bar A kind of good placebo for anxiety. If you want to use loading bar, you need to wrap the component where you call related methods inside n-loading-bar-provider and inject loadingBar. For example: ```html ``` ```js import { useLoadingBar } from 'naive-ui' import { defineComponent } from 'vue' // content export default defineComponent({ setup() { const loadingBar = useLoadingBar() return { loading() { loadingBar.start() } } } }) ``` ## Demos ```demo basic.vue container.vue ``` ## API ### LoadingBarProvider Props | Name | Type | Default | Description | Version | | --- | --- | --- | --- | --- | | container-class | `string` | `undefined` | Class of the loading bar container. | 2.33.4 | | container-style | `string \| object` | `undefined` | Style of the loading bar container. | 2.33.4 | | loading-bar-style | `{ loading?: string \| object, error?: string \| object }` | `undefined` | Style of the loading bar. | | | to | `string \| HTMLElement \| false` | `undefined` | Mount target of loading bar. | 2.33.4 | ### loadingBar Injection Methods | Name | Type | Description | | --- | --- | --- | | error | `() => void` | Callback function for loading bar error. | | finish | `() => void` | The callback function when the loading bar finishes loading. | | start | `() => void` | Callback function for loading bar to start loading. |