Shiny progress bar
A thin progress bar with a streak of light running over the filled part, so it looks alive even when paused.
Settings
Code
import { motion } from "framer-motion";
interface ShineProgressProps {
color?: string;
/** Progreso de 0 a 100. */
progress?: number;
/** Segundos que tarda el reflejo en cruzar. */
speed?: number;
}
export default function ShineProgress({
color = "#0071e3",
progress = 68,
speed = 1.5,
}: ShineProgressProps) {
return (
<div
role="progressbar"
aria-valuenow={progress}
aria-valuemin={0}
aria-valuemax={100}
className="h-1.5 w-64 overflow-hidden rounded-full bg-black/5 dark:bg-white/10"
>
<motion.div
className="relative h-full rounded-full"
style={{ width: `${progress}%`, backgroundColor: color }}
animate={{ width: `${progress}%` }}
transition={{ type: "spring", stiffness: 300, damping: 30 }}
>
<motion.span
className="absolute inset-y-0 w-16 bg-gradient-to-r from-transparent via-white/50 to-transparent"
animate={{ x: [-70, 260] }}
transition={{ duration: speed, repeat: Infinity, ease: "linear" }}
/>
</motion.div>
</div>
);
}
Prompt for AI
Paste it into ChatGPT, Claude or Cursor and it will adapt the block to your project with these settings, even if you don’t use React.
More in Loaders
Where to use it
Real progress rarely moves at a steady pace, and this bar deals with that nicely: the shine keeps running while the fill waits. Use it for a file export in a design tool, the download page of a desktop app or the step indicator of a multi-step checkout. It’s a progress bar with animation that stays understated.
Set the shine slower than you think; a quick flash every second looks nervous. On strong colors the streak shows best with a mid-tone. If your progress jumps in big steps, the spring on the width softens each jump.