PayslipDocument
A slip shown like a paper document.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/payslip-document.jsonIssued (placement="page")
Slip gaji · November 2026
- Dimas Pratama · MC-014
- Backend engineer · Engineering
- Rabu, 25 Nov · BCA ••••4521
Gaji pokokRp 13.100.000
Tunjangan transportRp 500.000
Tunjangan makanRp 400.000
Total pendapatanRp 14.000.000
BPJS Kes. & Ketenagakerjaan− Rp 510.863
PPh 21− Rp 980.000
Total potongan− Rp 1.490.863
Not issued, error, loading
Slip Desember terbit Kamis, 24 Des
Slip gagal dimuat.
Motion
Slip gaji · November 2026
- Dimas Pratama · MC-014
- Backend engineer · Engineering
- Rabu, 25 Nov · BCA ••••4521
Gaji pokokRp 13.100.000
Tunjangan transportRp 500.000
Tunjangan makanRp 400.000
Total pendapatanRp 14.000.000
BPJS Kes. & Ketenagakerjaan− Rp 510.863
PPh 21− Rp 980.000
Total potongan− Rp 1.490.863
When to use
- Slip gaji saya (employee): the right side of the month list.
- Admin "Slip November" detail Sheet (placement="sheet"), same document inside the sheet body.
- The PDF template: the export renders this component.
When not to use
- Only the net amount (Beranda tile) → StatTile "Slip gaji November".
- Many employees' pay in one view → Table (Gaji · Periksa total).
- Changing pay components → admin Sheet form, never this document.
Do and don't
Show the sum, so the user can check it"Rp 14.000.000 – Rp 1.490.863" under "Gaji bersih diterima". Older users verify by hand before they call HR.
Red deductions or a green netDeductions are normal, not errors. The net band uses the Gaji module tint, not success green. Short forms like "Rp 12,5 jt" never appear on the slip.
Installation
Add PayslipDocument 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 { PayslipDocument } from "@/components/mahr/payslip-document"| Prop | Type | Default | Description |
|---|---|---|---|
placement | "page" | "sheet" | "page" | sheet: one column, no tray, no shadow, no head button (download goes to the Sheet footer). |
slip | { period, company, employee, paid, earnings[], deductions[], totalEarnings, totalDeductions, net } | – | Totals and net come from the server; the component never sums. |
status | "issued" | "not-issued" | "loading" | "error" | "issued" | not-issued needs month + issueDate ("Desember", "Kamis, 24 Des"). |
onDownload · downloading | () => void · boolean | – · false | downloading swaps the button to "Menyiapkan…"; width stays. |
onRetry | () => void | – | error state "Coba lagi". |