Amount and status badge
A signed amount, sign in text and tone in colour; the state of a document in a word.
import { AmountBadge, StatusBadge } from "@forgeron/ui";€1,250.00credit€42.50debit€42.50debit€0.00
DraftSentPaidOverdue
import { AmountBadge, StatusBadge } from "@forgeron/ui";
export default function Default() {
return (
<div style={{ display: "grid", gap: 8 }}>
<AmountBadge amount={125000} currency="EUR" locale="en" />
<AmountBadge amount={-4250} currency="EUR" locale="en" />
<AmountBadge amount={-4250} currency="EUR" locale="en" invert />
<AmountBadge amount={0} currency="EUR" locale="en" />
<div style={{ display: "flex", gap: 8 }}>
<StatusBadge status="draft" />
<StatusBadge status="sent" />
<StatusBadge status="paid" />
<StatusBadge status="overdue" />
</div>
</div>
);
}API → Props
| Prop | Type | Default | Description |
|---|---|---|---|
amount | number | — | Minor units, signed. |
currency | string | — | An ISO 4217 code (`EUR`, `USD`, `JPY`): every amount is in its minor units. |
locale | string | — | A BCP 47 tag for the numbers and the symbol; the device's by default. |
tone | "auto" | "positive" | "negative" | "neutral" | "auto" | Auto: money in is positive, out negative. |
invert | boolean | false | Swaps the auto colours. |
showPlus | boolean | true | Writes + before a positive amount. |
StatusBadge status / tone / label | string | — | draft, sent, paid, overdue… map to a tone; any word with its tone. |
className | string | — | Extra classes. |