Stepper
Where the user is in a flow of 3–5 steps.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/stepper.jsonStates
In a flow (motion)
When to use
- The header row of a page that walks through 3–5 steps: Karyawan · Impor dari Excel (Unggah file → Cocokkan kolom → Cek data → Selesai).
- The same look for the later Gaji "Isi bulan ini" flow.
When not to use
- A form with 2+ fields that fits one panel → Sheet, no steps.
- Progress of a known whole (43 dari 48 siap) → Progress.
- The Ringkasan payroll timeline (dates under the nodes) → its own part, not this one.
Do and don't
Short step names, the same on every page"Cek data", not "Langkah 3: Periksa semua baris data". The page heading under it says what to do now.
Clickable stepsA click on a done step could skip the checks of the steps after it. Kembali in the action bar goes back one step.
Installation
Add Stepper 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 { Stepper } from "@/components/mahr/stepper"| Prop | Type | Default | Description |
|---|---|---|---|
steps | string[] | – | 3–5 short labels. |
current | number | – | 0-based index of the current step. steps.length = all done. |
aria-label | string | "Langkah" | e.g. "Langkah impor". Done steps read "…, selesai". |