042
An amount field that groups digits as you type without ever losing your caret, follows each currency's own rules (yes, lakh grouping and zero-decimal yen), and keeps the limits in view.
akacurrency input·money input·amount
Run this in any project set up for the shadcn CLI. It copies the Money Input source into your components folder, so the code is yours to change.
npx shadcn@latest add https://devl.dev/r/money-input.jsonImport it and render it. Every prop has a typed default, so it works straight away, and you pass your own data when you’re ready.
import { MoneyInput } from "@/components/money-input";
export default function Page() {
return <MoneyInput />;
}A free React component in the Forms collection, written in TypeScript with Tailwind CSS on coss ui. MIT licensed.
Read from the Money Input source. Everything is optional unless it says required.
| Prop | Type | Default |
|---|---|---|
| value | number | null | — |
| defaultValue | number | null | null |
| onValueChange | (value: number | null) => void | — |
| currency | string | — |
| defaultCurrency | string | "USD" |
| onCurrencyChange | (code: string) => void | — |
| currencies | Currency[] | CURRENCIES |
| min | number | — |
| max | number | — |
| label | ReactNode | "Amount" |
| hintAction | ReactNode | — |
| className | string | — |