ContactCard

Who to contact in HR, with WhatsApp and email.

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

States

Name + unit · hours (required: older users call during office hours), optional note, 1–2 secondary buttons (WhatsApp opens wa.me in a new tab). A missing channel is left out, never disabled. No contact set → one calm line.

Kontak HR Anda

Ayu WulandariHR & GA · Senin–Jumat, 08.00–17.00
Untuk ubah rekening bank, NIK, atau NPWP, pakai "Minta perubahan ke HR" di Profil.

Kontak HR Anda

Ayu WulandariHR & GA · Senin–Jumat

Kontak HR Anda

Kontak HR belum diatur. Tanyakan ke atasan Anda.

Motion

Motion: loading → card plays 14 skeleton reveal. The skeleton card pulses, then the real card cross-fades in with a 2px cross-blur (400 ms). Press "Muat ulang". Reduced motion: a short fade.

Kontak HR Anda

Ayu WulandariHR & GA · Senin–Jumat, 08.00–17.00

When to use

  • "Kontak HR Anda" under the ProfileCard on Beranda (employee and manager).
  • Anywhere the user may need help with data they cannot change (rekening, NIK, jabatan).

When not to use

  • The manager ("Atasan Anda") → PersonCard variant="manager": the one manager block, with Email / Telepon rows.
  • The signed-in person → ProfileCard.
  • A teammate in a grid → PersonCard.
  • A request that changes data → the "Minta perubahan ke HR" Sheet, not a WhatsApp chat.
  • General help articles → the Bantuan page.

Do and don't

DoA real name, hours, and plain buttons"Ayu Wulandari · HR & GA · Senin–Jumat" with WhatsApp + Email as white buttons. Dimas knows who answers and when.
Don'tA blue "Hubungi" primary or a green WhatsApp buttonIt steals the screen's one primary. Brand colours are never used: colour means status or module.

Installation

Add ContactCard 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/contact-card.json

API

import { ContactCard } from "@/components/mahr/contact-card"
PropTypeDefaultDescription
person{ name, photoUrl?, role, hours? } | null–null → "Kontak HR belum diatur" line.
whatsapp · emailstring?–Max 2 buttons (WhatsApp, Email). Missing ones are left out.
notestring?–One line in a neutral Callout.
wide · loadingboolean · booleanfalse · falsewide = buttons side by side.
error · onRetryboolean · () => voidfalseFailed load: the title, then "Gagal dimuat." + secondary "Coba lagi" (shared LoadError pattern). No person set is not an error: it shows one calm line.