Badge

A status word in its own colour. Never interactive.

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

Tones

5 tones. Nothing else exists. Colour carries meaning only; never rank.

DisetujuiMenunggu HRDitolakCutiDibatalkan

With dot

Sudah dibayarHangus 31 DesRekening kosong7 hari lagi

When to use

  • The status of one row or tile: Disetujui, Menunggu HR, Ditolak, Dibatalkan.
  • A short fact that changes over time: "Hangus 31 Des", "7 hari lagi", "Baru".

When not to use

  • Something the user must read and act on → Callout (a sentence, not a word).
  • A filter the user can click → SegmentedControl or Select (a Badge is never interactive).
  • A count on a rail item → the count badge of AppShell.

Which one?

Is it done / approved / paid?           → tone="success"Is it waiting, or does it expire soon?   → tone="warning"Is it rejected, an error or blocked?     → tone="danger"Is it about you, new, or plain info?     → tone="info"Default (cancelled, archived, a count)   → tone="neutral"

Do and don't

DoOne word or two"Menunggu HR". The badge sits right of the row; the row text says the rest.
Don'tUse green for "good" numbersA Badge is a status, not a score. "7 hari" is neutral, not success.

Installation

Add Badge 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/badge.json

API

import { Badge } from "@/components/ui/badge"
PropTypeDefaultDescription
tone"success" | "warning" | "danger" | "info" | "neutral""neutral"Closed set.
dotbooleanfalse6 px dot in the tone colour.
childrenReactNode–1–3 words, sentence case.
classNamestring–Layout only. Never change colours.