CurrencyInput
Locale-aware money input. Stores a number (single-currency) or a composite { amount, currency } object (multi-currency).
Installation
pnpm dlx shadcn@latest add @shadmin/currency-inputUsage
import { CurrencyInput } from '@/components/admin';
<CurrencyInput source="price" currency="USD" />
<CurrencyInput source="price" currencies={["USD", "EUR", "JPY"]} />
<CurrencyInput source="price" currency="USD" storeAsMinorUnits />Props
| Prop | Required | Type | Default | Description |
|---|---|---|---|---|
source | Required | string | - | Form field name |
currency | Optional | string | - | ISO-4217 code (single-currency mode) |
currencies | Optional | readonly string[] | - | Enable currency selector; stores composite |
displayLocale | Optional | string | App locale | Override locale for symbol/step |
storeAsMinorUnits | Optional | boolean | false | Store integer cents |
label | Optional | string | false | Inferred | Custom label, false to hide |
helperText | Optional | ReactNode | - | Helper text |
disabled | Optional | boolean | false | Disable input + currency selector |
defaultValue | Optional | number | { amount, currency } | - | Initial value |
validate | Optional | Validator | Validator[] | - | Validation |
className | Optional | string | - | CSS class on the row |
Single- vs multi-currency
Pass currency for single-currency apps; the value is a plain number. Pass
currencies to render a select beside the amount; the value is composite.
Don't pass both — currencies takes precedence.