ProfileCard
Photo, name, job facts, manager.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/profile-card.jsonVariants and loading
Dimas Pratama
Backend engineer · Engineering
Indra Wijaya
Indra Wijaya
Engineering manager · Engineering
Dimas Pratama
Backend engineer · Engineering
Data Anda lengkap
- 4 Jan 2024
- 2 tahun
- Tetap · tanpa tanggal akhir
- Jakarta
Record header (admin)
Galih Ramadhan
Sales associate · Sales & marketing
- 17 Nov 2026
- kurang dari 1 bulan
- Percobaan · sampai 17 Feb 2027
Galih belum bisa digaji: nomor rekening kosong.
Sinta Maharani
Staf keuangan · Finance
- 6 Feb 2023
- 3 tahun 7 bulan
- 30 Sep 2026
- Tidak ikut gaji
Diarsipkan sejak 30 Sep 2026 · Mengundurkan diri
Motion
Dimas Pratama
Backend engineer · Engineering
Indra Wijaya
When to use
- The left column of Beranda (employee and manager).
- The top of Profil saya (variant="header"), with the completeness block.
- The top of an admin record page (variant="header", Karyawan · Detail), with a status Badge and, when the record needs a step, a notice strip.
- Exactly one ProfileCard per screen: the signed-in person, or the one record of a detail page.
When not to use
- Another person in a list or grid → PersonCard.
- Label/value data that can be edited → DetailCard.
- The HR person to contact → ContactCard.
- A person inside a table row → Table person cell (Avatar 40 + 2 lines).
Do and don't
One relation, one way outDimas sees his Atasan and one nav row "Lihat profil saya". Contact details for HR live in the ContactCard below it.
Edit buttons or salary on the profile cardEditing happens in DetailCard on Profil saya. A blue "Lihat profil" link is wrong: navigation is dark text + grey chevron.
Installation
Add ProfileCard 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 { ProfileCard } from "@/components/mahr/profile-card"| Prop | Type | Default | Description |
|---|---|---|---|
variant | "employee" | "manager" | "header" | "employee" | Closed set. |
person | { name, photoUrl?, jabatan, departemen, employeeNo? } | – | employeeNo shows only in variant="header" (ID chip). |
manager | { name, photoUrl?, jabatan } | null | null | employee variant. null → no relation block. |
reports | { name, photoUrl? }[] | [] | manager variant. First 5 as avatars, then "+N". |
facts · completeness | { label, value }[] · { complete, missing? } | – | header variant only. Incomplete → warning block "N data belum diisi". Fact values sit in a 28 slot. While loading, pass the fact labels: the skeleton keeps the strip. |
status | ReactNode (one Badge) | – | header variant, record pages. Shown at the right instead of completeness. |
notice | { tone: "danger" | "warning" | "neutral"; title; description?; action? } | null | null | header variant. A strip under the facts with ONE Button (primary only when it is the page's next step). |
footerHref · footerRender | string · ReactElement | – | Footer label is fixed per variant. render={<Link href=… />} for your router. |
loading | boolean | false | Skeleton at real sizes; no fake name. |
error · onRetry | boolean · () => void | false | Failed load: "Gagal dimuat." + secondary "Coba lagi" inside the card, at the skeleton's height (shared LoadError pattern). |