EmptyState
Icon fan + title + one line.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/empty-state.jsonIcon sets
Belum ada cuti yang direncanakan
Belum ada karyawan
Tidak ada karyawan bernama "Budi"
Slip Desember terbit Kamis, 24 Des
Link ini sudah tidak berlaku
Daftar karyawan gagal dimuat
With one action
Belum ada karyawan
Tidak ada karyawan bernama "Budi"
Motion
Belum ada pengajuan cuti
Full-page message
When to use
- Every centred empty block: no requests yet, no employees yet, no slip yet.
- A search or filter with no results (pencarian set + "Hapus pencarian").
- A card body whose list is empty (Cuti mendatang).
When not to use
- One calm line inside a filled list ("Data Anda lengkap") → a ListRow, no fan.
- A load error → LoadError illustrated (this layout, set "gagal", tone danger, "Coba lagi" + the support code).
- A hint in an empty column → one line of muted text.
Do and don't
Say what happens next, with real data"Slip pertama Anda terbit Kamis, 24 Des" tells a new employee when to come back.
"Tidak ada data", a fan in a one-line row, fake sample rows"Tidak ada data" gives no next step. A 72-high fan inside a filled list breaks the rhythm.
Installation
Add EmptyState 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 { EmptyState } from "@/components/mahr/empty-state"| Prop | Type | Default | Description |
|---|---|---|---|
set | "cuti" | "organisasi" | "pencarian" | "slip" | "gagal" | "undangan" | – | Required. Picks the 3 icons. Closed set; no custom icons prop. "gagal" (connection · warning · retry) is for failed loads only. "undangan" (mail · link · clock) is for an invite link that no longer works. |
title · description | string · string | – | Both required. Description max 2 lines (3 with lines={3}). |
titleAs | "p" | "h1" | "h2" | "h3" | "p" | The title element. h1 when the empty state IS the page (Undangan · Link tidak berlaku). |
lines | 2 | 3 | 2 | Description lines before it is cut. 3 only for a full-page message (a phone needs the third line). |
action | ReactElement<typeof Button> | – | Optional. One Button. |
tone | "neutral" | "danger" | "neutral" | danger = a failed load: icons red at rest; on hover the fan spreads and all tiles turn soft red (one meaning, one colour). Use it through LoadError illustrated. |
note | ReactNode | – | One mono muted line under the action, e.g. the support code "Kode: EMP-500 · 16 Des 2026, 09.41". |
Hover | — | – | The fan hover needs the [data-slot="empty-state"] ancestor. A custom layout with a bare IconFan must put data-slot="empty-state" on its root (e.g. a first-run card). |
className | string | – | Layout only (e.g. flex-1 to fill the card body). The fan is aria-hidden. |