AsterUIDocsv1.0.2

Docs / Component reference

CurrencyInput

Enter an amount with its currency in view. Leave the field to see how the component formats the precision.

Currency input example

Install

sh
npx @fierst/ui@1.0.2 add currency-input

Registry dependencies: theme.

Exports from ./ui/currency-input: CurrencyInput.

Download the registry source for currency-input 1.0.2.

API contracts

ts
export function* CurrencyInput(
  props: {
    label?: string;
    currency?: 'USD' | 'EUR' | 'GBP' | 'JPY' | 'CAD';
    value?: number;
    defaultValue?: number;
    placeholder?: string;
    onChange?: (amount: number) => void;
    class?: string;
  },
  ctx: Ctx,
)