Overview
The InputNumber component provides a sophisticated input field specifically designed for numeric values. It includes locale-aware formatting, min/max validation, step controls, and optional spinner buttons.Component Selector
Basic Usage
With Spinner Buttons
Currency Format
Percentage Format
Properties
Value & Model
The numeric value (supports two-way binding with
[(value)])Formatting Options
Whether to format the number according to locale and mode settings
The formatting mode for the number:
decimal: Standard number formattingcurrency: Currency formatting with symbolpercent: Percentage formatting
The locale to use for number formatting (e.g., ‘en-US’, ‘de-DE’, ‘fr-FR’)
The locale matching algorithm to use
Whether to use grouping separators (e.g., thousands separators)
Minimum number of fraction digits to display
Maximum number of fraction digits to display
Currency Options
The currency code to use when mode is ‘currency’ (e.g., ‘USD’, ‘EUR’, ‘GBP’)
How to display the currency:
symbol: Use currency symbol ($, €)narrowSymbol: Use narrow symbolcode: Use currency code (USD, EUR)name: Use currency name (US Dollar)
Prefix & Suffix
Text to prepend before the formatted value
Text to append after the formatted value
Validation
Minimum allowed value. Values are clamped to this on blur
Maximum allowed value. Values are clamped to this on blur
The step increment/decrement value for spinner buttons and arrow keys
Whether to allow empty/null values
Spinner Buttons
Whether to display increment/decrement spinner buttons
Layout of spinner buttons:
stacked: Buttons stacked vertically on the righthorizontal: Buttons placed horizontally on both sidesvertical: Buttons stacked vertically
CSS class for the increment button
CSS class for the decrement button
Icon name for the increment button (Lucide icon)
Icon name for the decrement button (Lucide icon)
Input Configuration
Placeholder text for the input field
Whether the input is disabled
Whether the input is read-only
The size attribute of the input element
Maximum length of the input
Tab index of the input element
Name attribute for the input element
ID attribute for the input element
Styling
Inline styles for the input element
CSS class for the input element
Inline styles for the wrapper element
CSS class for the wrapper element
Events
Emitted when the input value changes
Emitted when the input receives focus
Emitted when the input loses focus. Value is formatted and validated on blur
Emitted on key down events
Form Integration
The InputNumber component implements
ControlValueAccessor and integrates with Angular forms.Reactive Forms
Keyboard Support
| Key | Action |
|---|---|
Arrow Up | Increment value by step |
Arrow Down | Decrement value by step |
Backspace / Delete | Delete characters |
Tab | Move focus to next element |
