HelpTribe.

ProgressBar

Multi-segment progress bar for displaying tiered measurements, fitness metrics, and score ranges. Highlights the active segment based on the current value.

Installation

$ npx shadcn@latest add progress-bar

Preview

45.3VO₂ MAX

Cardio Fitness

>15
25
34
GOOD
44
53+

Custom Segments

72SCORE

Performance

0-20
21-40
41-60
EXCELLENT
61-80
81-100

Usage (React/TSX)

import { ProgressBar } from "@/components/ui/progress-bar"

export default function FitnessCard() {
  return (
    <div className="p-6 rounded-xl border border-zinc-800 bg-zinc-900/40">
      <ProgressBar
        currentValue={45.3}
        unit="VO₂ MAX"
        label="Cardio Fitness"
        activeLabel="GOOD"
      />
    </div>
  )
}

Props

PropTypeDefaultDescription
currentValuenumber—The current value to display and determine the active segment.
unitstring""Unit label displayed next to the value (e.g., 'VO₂ MAX', 'SCORE').
labelstring—Descriptive label below the value.
activeLabelstring"GOOD"Label displayed above the active segment bar.
segmentsProgressBarSegment[]defaultSegmentsArray of segment objects with label, value threshold, color, and activeColor.
classNamestring—Additional CSS classes to apply.

Segment Props

PropTypeDefaultDescription
labelstring—Label displayed below the bar segment.
valuenumber—Threshold value for this segment.
colorstring—Background color when inactive.
activeColorstring—Background color when this segment is active.

Design Notes

  • 5 segments with increasing height from left to right.
  • Active segment glows with its activeColor and scales up slightly.
  • Inner gradient highlight on active bar for depth.
  • Labels dim for inactive segments, highlighted for active.
  • Use for fitness metrics, score ranges, tiered measurements.