Callout

A tinted note inside a card or panel.

$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/callout.json

Tones

5 tones follow the status families. Icons are fixed per tone: info-circle (neutral, info, warning), check-circle (success), alert-triangle (danger only, so it stays rare). The icon shows only when there is no title; with a title (see warning) the tint and the title carry the meaning.

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.

Inline and trailing

Inline = a full-width strip inside a Card, directly under its header. Trailing: one Badge OR one Button link (blue, only if it changes data). Never both.

Rekening & pajak

Permintaan ubah rekening dikirim 17 Des. Rekening lama tetap dipakai sampai HR mengubahnya.
Menunggu HR
RekeningBCA •••• 4521

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

DoSay what, when and what happens next"Permintaan ubah rekening dikirim 17 Des. Rekening lama tetap dipakai sampai HR mengubahnya."
Don'tStacks 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.

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

API

import { Callout } from "@/components/mahr/callout"
PropTypeDefaultDescription
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 · childrenstring? · 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.
trailingReactNode–One Badge OR one Button variant="link". Never both, never primary.
classNamestring–Layout only. Never colours. role="alert" for danger, "status" otherwise.