Docs
Currency Input

Currency Input

Input field for currency values with formatting.

Installation

Usage

import { CurrencyInput } from "@/components/ui/currency-input";
<CurrencyInput>{/* Example usage */}</CurrencyInput>

Props

CurrencyInput extends the functionality of react-currency-input-field with additional styling and features.

PropTypeDefaultDescription
classNamestring-The class name to apply to the component.
clearClassNamestring-Class name for the clear button.
hasErrorbooleanfalseShows error state with red border.
clearablebooleanfalseEnables clearing the input value.
onClear() => void-Callback when clear button is clicked.
leftAddonReactNode-Content to display before the input.
rightAddonReactNode-Content to display after the input.
leftControlReactNode-Control to display at the left of the input.
rightControlReactNode-Control to display at the right of the input.
prefixstring-The prefix to display before the value.
suffixstring-The suffix to display after the value.
decimalsLimitnumber-Maximum number of decimal places allowed.
decimalSeparatorstring.Character used as decimal separator.
groupSeparatorstring,Character used to separate thousands.
valuestring | undefined-The controlled value of the input.
defaultValuestring | undefined-The default uncontrolled value of the input.
onValueChange(value: string | undefined, name?: string) => void-Callback when value changes.