Money input
A currency field with live grouping, stable width, rolling digits, and minor-unit output.
Enter a bounded number with clear increment controls.
npx shadcn@latest add @silicon-ui/number-fieldnpx shadcn@latest add @silicon-ui/number-fieldInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/number-field/number-field.tsxcomponents/silicon-ui/number-field/number-field.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 | — |
value | number | — |
defaultValue | number | 0 |
onValueChange | (value: number) => void | — |
min | number | 0 |
max | number | Number.MAX_SAFE_INTEGER |
step | number | 1 |
largeStepPageUp, PageDown, and Shift with an arrow move this far. Defaults to ten steps. | number | — |
description | string | — |
disabled | boolean | — |
id | string | — |
prefixText before the number, such as "$". | NumberFieldAffix | — |
suffixText after the number, such as " seats". | NumberFieldAffix | — |
scrubDrag the label sideways to scrub the value, one step every few pixels. | boolean | false |
localeFormatting locale. Fixed by default so server and client render the same digits. | string | "en-US" |
formatOptionsFraction digits and grouping. Fraction digits follow the precision of `step` by default. | { minimumFractionDigits?: number; maximumFractionDigits?: number; useGrouping?: boolean } | — |
sizeControl height, type size, and default width. | NumberFieldSize
| "md" |
limitHintA short note beside the label when a press meets a limit or a typed value passes one. `false` hides it; a function writes the copy. | boolean | ((edge: "min" | "max", limit: number) => string) | true |