Locale-aware amount field. The control value is a number | null. While focused the field shows a raw editable number; on blur it formats with the currency’s fraction digits. Do not nest this inside base-input-group — it is a composite control.
Bind with ngModel like any other CVA control.
Value: 1299
Value: 49.99
Run the following command to add this component to your project:
npx base-ui-cli add currency-input
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Base UI MCP server.
npx -y base-ui-mcp
Base UI provides standalone components. Import the exact elements you want to use into your component.
// Install: npx base-ui-cli add currency-input
// Paths are relative to aliases.components (default: src/app/components)
import { CurrencyInputComponent } from './currency-input/currency-input.component';
@Component({
selector: 'app-your-component',
imports: [
CurrencyInputComponent
],
template: `...`
})
export class YourComponent {} API for currency-input — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
base-currency-input | class | string | '' | Extra host classes merged via `cn()`. |
base-currency-input | currency | unknown | 'USD' | ISO 4217 currency code used for formatting and the prefix symbol. |
base-currency-input | locale | unknown | 'en-US' | BCP 47 locale passed to `Intl.NumberFormat`. Defaults to `en-US`. |
base-currency-input | placeholder | unknown | '0.00' | Placeholder shown when the value is empty and the field is not focused. |
base-currency-input | ariaLabel | unknown | 'Amount' | Accessible name for the inner text field. |
base-currency-input | min | number | null | null | Minimum allowed value (applied on blur). Omit for no floor. |
base-currency-input | max | number | null | null | Maximum allowed value (applied on blur). Omit for no ceiling. |
base-currency-input | showSymbol | boolean | true | Hide the currency symbol prefix (the formatted value still uses the currency). |
Content