Progress bar
Track and fill bar with spring-animated width, travelling shimmer highlight, and cursor-proximity pastel glow on the track border. Fill colour shifts with cursor position via pastelColour.
- Spring Physics
- requestAnimationFrame
- pastelColour
progress-bar
Move your cursor near the bars.
Usage
Drop it in
import { ProgressBar } from "@/app/lib/components/progress-bar";<ProgressBar value={65} showLabel />
<ProgressBar value={100} />API
Props
| Prop | Type | Default |
|---|---|---|
value*Progress value 0-100 | number | — |
showLabelShow percentage label | boolean | false |
classNameAdditional class names | string | "" |
ariaLabelAccessible name for the progress bar | string | — |
Read from the component's source at build time. * required.
Accessibility
Works with
- Cursor
- Reacts to where the pointer is, not just whether it's over the element.
- Touch
- Follows your finger while it's down, then settles a moment after you lift.
- Keyboard
- Focus lights it up the way the cursor does. Every action has a key.
- Reduced motion
- Nothing moves or springs. Colour still answers, without drifting.