Slim progress bar (NProgress) for Web applications that use Axios library for HTTP requests.
npm install x-axios-progress-barhtml
``
---
$3
Invoke (only one time) the function: loadProgressBar(config, instance).
$3
The config argument is the configuration object for the nprogress and is not required. Its properties can be seen here.
$3
You can pass a Custom Axios Instance as a second argument if needed, the argument is not required. If you don't set the instance argument the default axios instance will be used.
__Also, you need to import the CSS file (nprogress.css) that contains the customization of the progress bar.__
#### Example in ES6 using the import statement
`js
import { loadProgressBar } from 'x-axios-progress-bar'
loadProgressBar()
...
``
Don't forget to import the CSS in the HTML, or through JavaScript with some module bundler like webpack.
`html
`
`js
import 'x-axios-progress-bar/dist/nprogress.css'
`
#### Example using plain HTML and JavaScript in the Browser
`html
...
`
$3
Sometimes we don't want to show the progress bar for an axios request (like UX which have degradeable typeaheads).
To prevent it from popping up for that request, you can pass in false for the progress parameter in your axios request.
`js
axios.get('URL', { progress: false })
axios.post('URL', data, { progress: false })
`
$3
The CSS file contains the properties from the nprogress style. However, It's possible to override the properties or set new ones with a custom CSS.
In the next example, the custom CSS only changes the color of the progress bar and the spinner to red.
`html
...
``