Atelier UI

Search components…

Search components…

Currency Input

Formatted money input with live thousands separators, decimals on blur, a currency selector and min/max validation.

Edit in sandbox

Copy a prompt for your AI coding tool with the source, dependencies and usage

Props

CurrencyInputProps

Also accepts all props of Omit<React.ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "min" | "max" | "type" | "size">

PropTypeDefaultDescription
valuenumber | null—Controlled numeric value (null = empty)
defaultValuenumber | nullnull—
onValueChange(value: number | null) => void——
currencyCurrencyCode—Controlled currency
defaultCurrencyCurrencyCode"USD"—
onCurrencyChange(currency: CurrencyCode) => void——
lockCurrencybooleanfalseHide the currency selector and lock the currency
minnumber——
maxnumber——
labelstring——
hintstring——
errorstring—External error message (takes precedence over min/max validation)

Install

$ npx shadcn@latest add https://chromotion.dev/r/currency-input.json

More like this