Progress
The share of a known whole, next to its figure.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/progress.jsonTones and sizes
43 dari 48karyawan siap dibayar
5dari 12 hari cuti tahunan tersisa
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
Words 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.
A 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.
API
import { Progress } from "@/components/ui/progress"| Prop | Type | Default | Description |
|---|---|---|---|
value · max | number · number | – · 100 | value 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-valuetext | string · string? | – | Required: what the bar measures. valuetext gives the value in words ("5 dari 12 hari"). |