EmptyState

Icon fan + title + one line.

$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/empty-state.json

Icon sets

6 sets ("gagal" is red: failed loads only, through LoadError). Nothing else exists: a new area picks the closest set, or adds a set here first. Grey at rest. Hover a card (mouse): the fan spreads and the icons turn success / primary / brand-pink.

Belum ada cuti yang direncanakan

Terakhir: Rabu, 16 Des · 1 hari, disetujui

Belum ada karyawan

Masukkan semua karyawan sekali saja.

Tidak ada karyawan bernama "Budi"

Cek ejaan, atau cari dengan ID karyawan.

Slip Desember terbit Kamis, 24 Des

Gaji Desember dibayar lebih awal 1 hari.

Link ini sudah tidak berlaku

Minta link baru ke HR perusahaan Anda.

Daftar karyawan gagal dimuat

Periksa koneksi internet, lalu coba lagi.

With one action

Secondary, or primary only when it is the page's next step.

Belum ada karyawan

Masukkan semua karyawan sekali saja.

Tidak ada karyawan bernama "Budi"

Cek ejaan, atau cari dengan ID karyawan.

Motion

Motion: 18 texts reveal on mount. Title, line and action rise 8px and fade in with a 40 ms stagger (80 ms in total). The icon fan fans out once from a stack (centre first, sides 40 ms later, 500 ms). With a mouse, hovering the block spreads the fan: sides ±18° and 6 px out, centre 4 px up, deeper shadow, icons grey → success / primary / brand-pink; spread 250 ms --ease-smooth-out, settle back 320 ms --ease-bounce. Press "Tampilkan ulang". Reduced motion: no movement; the colour still changes.

Belum ada pengajuan cuti

Pengajuan yang Anda kirim akan muncul di sini, lengkap dengan statusnya.

Full-page message

A page that is only a message (Undangan · Link tidak berlaku, 404, Akses ditolak, account turned off, maintenance) = AuthLayout cardAlign="center" + ONE EmptyState, nothing else. The card removes the EmptyState padding by itself: no className. titleAs="h1" (it is the page heading); lines={3} for a long line on a phone. One secondary that hugs its label; a real link when it navigates (docs/buttons.md, dead-end page). Same motion as every empty state.

Link ini sudah tidak berlaku

Link undangan berlaku 7 hari dan hanya bisa dipakai sekali. Minta link baru ke HR perusahaan Anda.

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

DoSay what happens next, with real data"Slip pertama Anda terbit Kamis, 24 Des" tells a new employee when to come back.
Don't"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.

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

API

import { EmptyState } from "@/components/mahr/empty-state"
PropTypeDefaultDescription
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 · descriptionstring · 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).
lines2 | 32Description lines before it is cut. 3 only for a full-page message (a phone needs the third line).
actionReactElement<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.
noteReactNode–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).
classNamestring–Layout only (e.g. flex-1 to fill the card body). The fan is aria-hidden.