moja kirijadesign

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.tsx

Import 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
role="page"
8.120,50RSD
role="card"
4.200,00RSD
role="row"
−1.500,00RSD
role="bill"
—
role="inline" · no figure yet

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

PropTypeDefaultDescription
childrenstring | null—The figure as formatMoney wrote it (52.830,00). null or "" draws an em dash and no currency.
currencystring—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.