Tricks

Add global progress bar

Jan 6, 2023
Arthur Minasyan
Admin panel, Integration

This component shows a progress bar at the top of the page when we navigate from one page to another.

Add this piece of code to the service provider.

Filament::registerScripts([
'https://cdn.jsdelivr.net/npm/pace-js@latest/pace.min.js',
], shouldBeLoadedBeforeCoreScripts: true);

Then paste this into your css file.

.pace {
-webkit-pointer-events: none;
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none
}
 
.pace-inactive {
display: none
}
 
.pace .pace-progress {
background: #3b82f6;
position: fixed;
z-index: 2000;
top: 0;
right: 100%;
width: 100%;
height: 3px
}

Result:

avatar

"Add this piece of code to the service provider" Name File..? "Then paste this into your css file." Name File..?

avatar

You should decide in which service provider you want to write that code, the same about the css file.