Products · Components

AmountInput

A field for an amount of money, in large type.

Keep amounts in minor units, as Monime's API does, and pass them to dash.payments.request as they are.

Children: Nothing

Example

The AmountInput component
view.dml
<AmountInput label="Amount" value="{{ amount }}" onChange="setAmount" />
controller.ts
export default definePage({
  initialState: { amount: 15000 },
  mutations: {
    setAmount: (_state, event: ValueEvent<number | null>) => ({ amount: event.detail.value }),
  },
});

Props

PropTypeWhat it is
valuenumber
currencystringThe ISO 4217 code shown before the amount. Default: SLE.
minorUnitsnumberDigits after the decimal point. Default: the currency's own, 2 for SLE.
unitminor, majorWith minor, 150 is SLE 1.50. With major, 1 is SLE 1.00. Default: minor.
labelstring
placeholderstring
hintstringHelp shown under the field, which error replaces.
errorstringShown under the field in red, in place of hint.
disabledbooleanDims it, and the person can't use it.

Events

EventSendsNotes
onChange{ value } in detailThe amount in unit, or null when empty.

Keep reading

On this page