Currency Input

Money input with a currency code prefix, decimal keypad on mobile and tabular numbers. Controlled via a string value to avoid rounding issues in React forms.

src/registry/ui/currency-input.tsx/r/currency-input.json

Installation#

bash
npx shadcn@latest add @minidev/currency-input

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/currency-input.json

Usage#

tsx
import { CurrencyInput } from "@/components/ui/currency-input"

export function Example() {
  return (
    <CurrencyInput aria-label="Amount" />
  )
}

API reference#

CurrencyInput props
PropTypeDefault
valuestring-
onChange(value: string) => void-
currencystring"USD"
disabledboolean-
classNamestring-
idstring-
aria-labelstring-

Dependencies#

npm

React only

Built from

Examples#

All form components