Home / Snippets / How to Show Progress Bar Loading Indicator in Inertia JS
How to Show Progress Bar Loading Indicator in Inertia JS cover

How to Show Progress Bar Loading Indicator in Inertia JS

1.7K

2 years ago

0 comments

In Inertia Js you can make use of the InertiaProgress to show a loading bar indication when processing / navigating between pages. To do this you can first install the package. Use the NPM or YARN to install Inertia JS Progress bar package.
npm install @inertiajs/progress
yarn add @inertiajs/progress

Import the InertiaProgress and init it. It's very straight forward as follows. Do note that this is within the "resources/js/app.js" file.
import { InertiaProgress } from '@inertiajs/progress'

InertiaProgress.init()

If you do want to change the progress bar color then specify it like the following.
/**
 * Change the color of the inertia progress bar
*/
InertiaProgress.init({ color: "#4B5563" });
I hope this snippets do help you and cheers! Happy coding.
notion avatar

Ahabz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this