Number field
Enter a bounded number with clear increment controls.
A currency field with live grouping, stable width, rolling digits, and minor-unit output.
npx shadcn@latest add @silicon-ui/money-inputnpx shadcn@latest add @silicon-ui/money-inputInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/money-input/money-input.tsxcomponents/silicon-ui/money-input/money-input.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
label* | string | — |
hideLabel | boolean | false |
valueAmount in minor units (cents for USD, yen for JPY). `null` is empty. | number | null | — |
defaultValue | number | null | null |
onValueChange | (value: number | null, details: MoneyInputDetails) => void | — |
currencyISO 4217 code, such as "USD". | string | — |
defaultCurrency | string | "USD" |
onCurrencyChange | (currency: string) => void | — |
currenciesCodes offered by the currency menu. Pass one code to hide the menu. | string[] | ["USD", "EUR", "GBP", "JPY", "CAD", "AUD", "CHF", "INR"] |
minLowest amount in minor units. Checked when the field loses focus. | number | — |
maxHighest amount in minor units. Typing past it is refused with a nudge. | number | — |
quickAddQuick add chips in major units. Pass an empty array to hide them. | number[] | [10, 50, 100] |
stepArrow keys move by this many minor units. Defaults to one major unit; Shift moves ten times as far. | number | — |
localeFormatting locale. Fixed by default so server and client render the same digits. | string | "en-US" |
description | string | — |
errorReplaces the built-in range message. | string | — |
disabled | boolean | false |
nameAdds a hidden input carrying the amount in minor units. | string | — |
id | string | — |
className | string | — |
onBlur | (event: ReactFocusEvent<HTMLInputElement>) => void | — |
Also accepts the props of HTMLAttributes.