复制一段给 AI 编程工具的提示词,包含源码、依赖和用法
属性
CurrencyInputProps
同时支持以下类型的全部属性: Omit<React.ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "min" | "max" | "type" | "size">
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| value | number | null | — | Controlled numeric value (null = empty) |
| defaultValue | number | null | null | — |
| onValueChange | (value: number | null) => void | — | — |
| currency | CurrencyCode | — | Controlled currency |
| defaultCurrency | CurrencyCode | "USD" | — |
| onCurrencyChange | (currency: CurrencyCode) => void | — | — |
| lockCurrency | boolean | false | Hide the currency selector and lock the currency |
| min | number | — | — |
| max | number | — | — |
| label | string | — | — |
| hint | string | — | — |
| error | string | — | External error message (takes precedence over min/max validation) |
安装
$ npx shadcn@latest add https://chromotion.dev/r/currency-input.json