Components
Amount
A figure at one of the sizes the product draws figures at, with its currency beside it.
Accepted· apps/web/components/ui/amount.tsxImport from @/components/ui/amount.tsx. The role names what the figure is on the screen; the size is the consequence. Formatting is not this component's job: formatMoney writes 52.830,00 and Amount takes that string.
Roles
12.345,00RSD
8.120,50RSD
4.200,00RSD
−1.500,00RSD
—
Rules
- A leading hyphen becomes U+2212, the minus sign, which has the tabular advance.
- A negative stays ink: money going the other way is not an exception.
- No figure yet is an em dash in the figure's face, with no currency after it.
- An amount never animates.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | string | null | — | The figure as formatMoney wrote it (52.830,00). null or "" draws an em dash and no currency. |
currency | string | — | RSD, EUR, kWh, m², set beside the figure, never inside it. |
role | "page" | "card" | "row" | "bill" | "inline" | "inline" | What the figure is on the screen; the size follows. page is the one number a screen exists for. |