Callout
A tinted note inside a card or panel.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/callout.jsonTones
Untuk ubah rekening bank, NIK, atau NPWP, pakai "Minta perubahan ke HR".
Gaji Desember dibayar Kamis, 24 Des. Lebih awal 1 hari karena 25 Des libur Natal.
Data Anda lengkap. Tidak ada yang perlu diisi.
Sisa cuti hangus 31 Des
Anda masih punya 5 hari cuti tahunan. Pakai sebelum akhir tahun.
Slip gagal dimuat. Coba lagi beberapa saat lagi.
Inline and trailing
Rekening & pajak
Permintaan ubah rekening dikirim 17 Des. Rekening lama tetap dipakai sampai HR mengubahnya.
RekeningBCA •••• 4521
Slip gagal dimuat.
When to use
- A state that lasts: "Permintaan ubah rekening dikirim 17 Des · Menunggu HR".
- A rule the user must know before acting: "Lebih awal 1 hari: 25 Des libur Natal".
- A blocking problem on the page: "5 karyawan belum bisa digaji".
- A confirmation that stays: "Data Anda lengkap".
When not to use
- The result of an action that just happened → Toast (it goes away).
- A field problem → the field's error text under the field.
- A status of one row → Badge in the row.
- A decision the user must confirm → Dialog. Nothing to show → EmptyState.
Do and don't
Say what, when and what happens next"Permintaan ubah rekening dikirim 17 Des. Rekening lama tetap dipakai sampai HR mengubahnya."
Stacks of callouts, or "Perhatian!" titlesMax one Callout per card and two per page. A title that only says "Perhatian" says nothing: name the problem ("Sisa cuti hangus 31 Des"). No warning icon before a title.
Installation
Add Callout 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 { Callout } from "@/components/mahr/callout"| Prop | Type | Default | Description |
|---|---|---|---|
tone | "neutral" | "info" | "success" | "warning" | "danger" | "info" | Sets fill, ring, icon colour and the fixed icon. |
layout | "block" | "inline" | "block" | inline = strip inside a Card under its header (no radius, line above). |
title · children | string? · ReactNode | – | children = 1–2 sentences, plain text, text-body 16/24 (the board's 15/22 is off the type scale). With a title: no icon. |
trailing | ReactNode | – | One Badge OR one Button variant="link". Never both, never primary. |
className | string | – | Layout only. Never colours. role="alert" for danger, "status" otherwise. |