Progress

The share of a known whole, next to its figure.

$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/progress.json

Tones and sizes

default 12 high in cards (payroll readiness: success; leave balance: cuti), sm 8 inside a row (upload: primary). The figure or sentence beside the bar carries the number; the bar is never alone. The fill width moves in --duration-slow + --ease-smooth-out; no motion with reduced motion.

43 dari 48karyawan siap dibayar

5dari 12 hari cuti tahunan tersisa

Mengunggah… 0,9 dari 1,4 MB64%

When to use

  • The share of a known whole, next to its figure: "43 dari 48 karyawan siap dibayar" (Ringkasan), "5 dari 12 hari cuti tahunan tersisa" (Karyawan · Detail).
  • A running task with a known size: a file upload (size sm).

When not to use

  • A single number without a whole → StatTile figure, no bar.
  • Steps of a process (1 of 3) → a checklist of rows, not a bar.
  • Waiting for an unknown time → the Button loading spinner or a skeleton.

Do and don't

DoWords first, bar second"5 dari 12 hari cuti tahunan tersisa" above the bar. An older user reads the sentence; the bar only confirms it at a glance.
Don'tA bar without a number, or a colour as a ratingA green bar for "good" and a red one for "bad" is a score, not a status. Pick the tone by what the bar measures, not by how full it is.

Installation

Add Progress with the shadcn CLI (your project needs a components.json and the MaHR theme: https://mahrdesign.faizintifada.com/r/theme.json), or copy the files by hand.

terminal
bunx --bun shadcn@latest add https://mahrdesign.faizintifada.com/r/progress.json

API

import { Progress } from "@/components/ui/progress"
PropTypeDefaultDescription
value · maxnumber · number– · 100value is clamped to 0 … max.
tone"primary" | "success" | "warning" | "danger" | "cuti""primary"Closed set. cuti = the leave module colour, leave balances only.
size"default" | "sm""default"12 in cards, 8 inside a row.
aria-label · aria-valuetextstring · string?–Required: what the bar measures. valuetext gives the value in words ("5 dari 12 hari").