Skip to content

MoneyInput

An amount of money, typed and shown in the currency format of the locale with the decimals that currency has. The value is in major units, or in whole minor units with minorUnits, and null when empty. An optional currency choice sits beside the amount.

  • MoneyInput
Status
Stable
axe:
Light, Dark, High contrast
Unit tests:
yes
Keyboard pass:
not yet
Screen reader pass:
not yet
Used in:
no app yet

PreviewLink to the section Preview

Live in all three themes. Everything here is interactive.

Light theme, MoneyInput

Gross, with VAT.
Currency
Enter the amount from the invoice.

Dark theme, MoneyInput

Gross, with VAT.
Currency
Enter the amount from the invoice.

High contrast theme, MoneyInput

Gross, with VAT.
Currency
Enter the amount from the invoice.

UsageLink to the section Usage

tsx
import { MoneyInput } from '@skribly/ui/forms'
tsx
<MoneyInput label="Amount" currency="PLN" value={amount} onChange={setAmount} />

Every label is a prop, so the app passes its own words in its own language. See no built-in text.

AccessibilityLink to the section Accessibility

  • The amount is a spin button text field: the arrow keys step it, and the formatted value with its currency is read out.
  • Without allowNegative the minus sign cannot be typed.
  • The currency choice is a separate labelled select, and each currency is named in the locale, not only by its code.

This demo runs through axe in all three themes on every test run. See what the tests check.

Search this site

Arrows move through the results, Enter opens one, Esc closes. Ctrl K /