Stepper

Where the user is in a flow of 3–5 steps.

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

States

Done = green disc + white check, green connector after it. Current = white disc, 2 px blue ring, blue number. Upcoming = 2 px grey ring, grey number and label. Node 32, label 16/24 600, gap 10; connector 40 × 2; steps 12 apart. current = steps.length shows every step done (the result page).

In a flow (motion)

Press Lanjut: the step fills green and its check appears (--duration-quick); the connector after it fills left to right (--duration-slow, ease-smooth-out). Reduced motion: at once. The steps are not links: Kembali is the only way back.

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

DoShort 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.
Don'tClickable 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.

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

API

import { Stepper } from "@/components/mahr/stepper"
PropTypeDefaultDescription
stepsstring[]–3–5 short labels.
currentnumber–0-based index of the current step. steps.length = all done.
aria-labelstring"Langkah"e.g. "Langkah impor". Done steps read "…, selesai".