InputNumber
Enter a number within certain range with the mouse or keyboard.
When To Use
- When a numeric value needs to be provided.
Types of Supports
sbyte, byte, short, ushort, int, uint, long, ulong, float, double, decimal
Nullable types of the above types are also supported. For example, ushort?, int?, etc.
Examples
InputNumber API#
| Property | Description | Type | Default Value |
|---|---|---|---|
| Precision | ParameterNumber of decimal places to use for number and display | Int32 | 0 |
| Formatter | ParameterFormatter from number to string for displaying | Func<TValue, String> | -- |
| Format | ParameterParser to extract number from the formatter | String | -- |
| Parser | ParameterSpecifies the value extracted from formatter | Func<String, String> | -- |
| Step | ParameterThe number to which the current value is increased or decreased with the input arrows. It can be an integer or decimal. | TValue | -- |
| DefaultValue | ParameterInitial value | TValue | -- |
| Max | ParameterMax alloable number | TValue | -- |
| Min | ParameterMin allowable number | TValue | -- |
| MaxLength | ParameterMax length of input | Int32? | false |
| Disabled | ParameterDisable the input or not | Boolean | -- |
| OnChange | ParameterCallback executed when the input value changes | EventCallback<TValue> | -- |
| OnFocus | ParameterCallback executed when the input gains focus | EventCallback<FocusEventArgs> | -- |
| PlaceHolder | ParameterPlaceholder value | String | -- |
| Bordered | ParameterWhether to show border | Boolean | -- |
| Prefix | ParameterSetting prefix content to the input | OneOf<String, RenderFragment> | -- |
| Width | ParameterThe width of the input | String | -- |
| ValidationMessages | Validation messages for the FormItem | String[] | -- |
| Value | ParameterGets or sets the value of the input. This should be used with two-way binding. | TValue | -- |
| ValueChanged | ParameterCallback that updates the bound value. | EventCallback<TValue> | -- |
| ValueExpression | ParameterAn expression that identifies the bound value. | Expression<Func<TValue>> | -- |
| ValuesExpression | ParameterAn expression that identifies the enumerable of bound values. | Expression<Func<IEnumerable<TValue>>> | -- |
| Size | ParameterThe size of the input box. Note: in the context of a form, `InputSize.Large` is used. Available: `InputSize.Large` `InputSize.Default` `InputSize.Small` | InputSize | InputSize.Default |
| CultureInfo | ParameterWhat Culture will be used when converting string to value and value to string Useful for InputNumber component. | CultureInfo | CultureInfo.CurrentCulture |
| AdditionalAttributes | ParameterAdditional HTML attributes for the component's DOM target. See the arbitrary attributes documentation for composite components and attribute precedence. | IReadOnlyDictionary<String, Object> | -- |
| Class | ParameterSpecifies one or more class names for an DOM element. | String | -- |
| Style | ParameterSpecifies an inline style for a DOM element. | String | -- |
| Id | ParameterID for the component's HTML and its component props override entry. | String | -- |
| RefBack | ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. |
ForwardRef | -- |