Progress Bar Loader
This is a loader component that realizes three types of progress bar animations: gradation, stripe, and pulse using pure CSS.
HTMLCSS
Preview
3 types of progress bar animations. No JavaScript required, pure CSS implementation.
gradient + shimmer
striped bar
pulse bar
Use cases and features
- File upload progress display: Can be used as a fake bar to express progress with CSS animation.
- 3 types of animation patterns: You can choose according to each theme.
- Pure CSS implementation: No framework required. Complete with just
@keyframes. - Height can be freely adjusted: Just change
heightof.pb-track.
Points of design and UX
- Gradient bar: Achieve shimmer effect with
background-size: 200%andbackground-positionanimation. - Stripe bar: A representation of flowing stripes with
repeating-linear-gradientandbackground-positionanimations. - Pulse bar: A moving bar that appears during high load processing with intermittent
opacity.
How to customize
Change the height:
.pb-track { height: 12px; } /* Thick */
.pb-track { height: 4px; } /* Thin */
Change the gradient color:
.pb-gradient .pb-fill {
background: linear-gradient(90deg, #06b6d4, #3b82f6, #8b5cf6);
}
Implementation code
<div class="pb-preview-bg">
<div class="pb-item">
<div class="pb-label">gradient + shimmer</div>
<div class="pb-track"><div class="pb-fill pb-gradient-fill"></div></div>
</div>
<div class="pb-item">
<div class="pb-label">striped bar</div>
<div class="pb-track"><div class="pb-fill pb-striped-fill"></div></div>
</div>
<div class="pb-item">
<div class="pb-label">pulse bar</div>
<div class="pb-track"><div class="pb-fill pb-pulse-fill"></div></div>
</div>
</div>
<style>
`
.pb-preview-bg {
width: 100%;
max-width: 400px;
display: flex;
flex-direction: column;
gap: 2rem;
}
.pb-item {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.pb-label {
color: #fff;
font-size: 0.9rem;
font-family: sans-serif;
}
.pb-track {
width: 100%;
height: 8px;
background: rgba(255,255,255,0.1);
border-radius: 999px;
overflow: hidden;
}
.pb-fill {
height: 100%;
border-radius: 999px;
width: 0%;
}
.pb-gradient-fill {
background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
background-size: 200% 100%;
animation: pb-slide 2s ease infinite, pb-shimmer 2s linear infinite;
}
.pb-striped-fill {
background-color: #3b82f6;
background-image: repeating-linear-gradient(
45deg,
rgba(255, 255, 255, 0.15) 0px,
rgba(255, 255, 255, 0.15) 10px,
transparent 10px,
transparent 20px
);
background-size: 28px 28px;
animation: pb-slide 2.5s ease infinite, pb-stripe 1s linear infinite;
}
.pb-pulse-fill {
background: #10b981;
animation: pb-slide 3s ease infinite, pb-pulse 1.5s ease-in-out infinite alternate;
}
@keyframes pb-slide {
0% { width: 0%; }
80%, 100% { width: 100%; }
}
@keyframes pb-shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
@keyframes pb-stripe {
0% { background-position: 0 0; }
100% { background-position: 28px 0; }
}
@keyframes pb-pulse {
0% { opacity: 0.6; }
100% { opacity: 1; box-shadow: 0 0 8px 2px rgba(16, 185, 129, 0.5); }
}
`
</style> Browser compatibility status
| Browser | Compatibility status |
|---|---|
| Chrome 43+ | ✅ Fully compatible |
| Firefox 16+ | ✅ Fully compatible |
| Safari 9+ | ✅ Fully compatible |
| Edge 79+ | ✅ Fully compatible |