Overview
Input Number is a form entry component, where users can enter a number to submit. The component can limit the values with its min and max properties.
Sample
Usage
- Number submissions in forms
Accessibility
Keyboard navigation
| Key | Function |
|---|---|
Tab | Moves focus in and out of the component. |
Tab and Shift | Moves focus in and out of the component. |
Esc | When clearable is true, clears the component's value. |
Best practices
Displaying units
prefixText to display a unit before the value, such as a currency symbol.suffixText to display a unit after the value, such as a temperature scale.Constraining values
Use the min, max, and step properties to define the expected range and increments for a value. The properties guide the increment and decrement controls and contribute to form validation, but do not prevent users from typing a value outside the specified constraints. Validate the value and provide an actionable validationMessage when needed.
min and max to define the expected range.step to define the expected increments for a value.Using validation messages
Use validationMessage to provide guidance when an Input Number's status is "invalid". The validationMessage should explain how to fix the error and avoid generic messages such as "invalid value".
validationMessage to give users clear, actionable guidance when a value is invalid.validationMessage that doesn't give users enough context to correct the error.Inline editing

inlineEdit for on-screen settings that users may need to revise after saving.inlineEdit to "controls-disabled" for low-risk changes that do not require confirmation or cancellation.
inlineEdit in a form.API reference
Properties
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
| alignment | alignment | Specifies the text alignment of the component's | Alignment | "start" |
| autocomplete | autocomplete | Specifies the type of content to autocomplete, for use in forms. Read the native attribute's documentation on MDN for more info. | AutoFill | undefined | |
| clearable | clearable | When | boolean | false |
| disabled | disabled | When | boolean | false |
| form | form | Specifies the | string | undefined | |
| groupSeparator | group-separator | When | boolean | false |
| icon | icon | Specifies an icon to display. | IconName | boolean | undefined | |
| iconFlipRtl | icon-flip-rtl | When | boolean | false |
| inlineEdit | inline-edit | Enables inline editing. When not editing, the component displays without a border.
When | boolean | "controls-disabled" | false |
| inlineEditing | inline-editing | When | boolean | false |
| inlineEditingBeforeConfirm | When | (() => Promise<void>) | undefined | ||
| integer | integer | When | boolean | false |
| label | label | Specifies an accessible label for the component. | string | undefined | |
| labelText | label-text | Specifies the component's label text. | string | undefined | |
| loading | loading | When | boolean | false |
| max | max | When the component resides in a form,
specifies the maximum | number | undefined | |
| maxLength | max-length | When the component resides in a form,
specifies the maximum length of text for the component's | number | undefined | |
| messageOverrides | Replace localized message strings with your own strings. Note: Individual message keys may change between releases. | Record<string, unknown> | undefined | ||
| min | min | When the component resides in a form,
specifies the minimum | number | undefined | |
| minLength | min-length | When the component resides in a form,
specifies the minimum length of text for the component's | number | undefined | |
| name | name | Specifies the name of the component. Required to pass the component's | string | undefined | |
| numberButtonType | number-button-type | Specifies the placement of the buttons. | InputPlacement | "vertical" |
| numberingSystem | numbering-system | Specifies the Unicode numeral system used by the component for localization. | NumberingSystem | undefined | |
| placeholder | placeholder | Specifies the component's placeholder text. | string | undefined | |
| prefixText | prefix-text | Specifies text to display at the start of the component. | string | undefined | |
| readOnly | read-only | When | boolean | false |
| required | required | When | boolean | false |
| scale | scale | Specifies the size of the component. | Scale | "m" |
| status | status | Specifies the input field's status, which determines message and icons. | Status | "idle" |
| step | step | Specifies the granularity that the component's | number | "any" | undefined | |
| suffixText | suffix-text | Specifies text to display at the end of the component. | string | undefined | |
| validationIcon | validation-icon | Specifies the validation icon to display under the component. | IconName | boolean | undefined | |
| validationMessage | validation-message | Specifies the validation message to display under the component. | string | undefined | |
| validity | The component's current validation state. | ValidityState | ||
| value | value | The component's value. | string |
Slots
| Name | Description |
|---|---|
| action | A slot for positioning a |
| label-content | A slot for rendering content next to the component's |
Styles
| Name | Description |
|---|---|
| --calcite-input-actions-background-color | Specifies the background color of the component's |
| --calcite-input-actions-background-color-hover | Specifies the background color of the component's |
| --calcite-input-actions-background-color-press | Specifies the background color of the component's |
| --calcite-input-actions-icon-color | Specifies the icon color of the component's |
| --calcite-input-actions-icon-color-hover | Specifies the icon color of the component's |
| --calcite-input-actions-icon-color-press | Specifies the icon color of the component's |
| --calcite-input-loading-background-color | When |
| --calcite-input-loading-fill-color | When |
| --calcite-input-number-background-color | Specifies the component's background color. |
| --calcite-input-number-border-color | Specifies the component's border color. |
| --calcite-input-number-corner-radius | Specifies the component's border radius. |
| --calcite-input-number-icon-color | Specifies the component's icon color. |
| --calcite-input-number-height | Specifies the component's height. |
| --calcite-input-number-placeholder-text-color | Specifies the text color of the component's placeholder. |
| --calcite-input-number-text-color | Specifies the component's text color. |
| --calcite-input-number-text-color-focus | Specifies the component's text color when focused. |
| --calcite-input-prefix-size | When |
| --calcite-input-prefix-text-color | When |
| --calcite-input-suffix-size | When |
| --calcite-input-suffix-text-color | When |
| --calcite-input-number-inline-edit-background-color-hover | When |
| --calcite-input-number-inline-edit-control-background-color | When |
| --calcite-input-number-inline-edit-control-background-color-hover | When |
| --calcite-input-number-inline-edit-control-background-color-press | When |
| --calcite-input-number-inline-edit-control-corner-radius | When |
| --calcite-input-number-inline-edit-control-loader-color | When |
| --calcite-input-number-inline-edit-control-text-color | When |
| --calcite-input-number-inline-edit-control-text-color-press | When |
Events
| Name | Description | Behavior |
|---|---|---|
| calciteInputNumberChange | Fires each time a new | |
| calciteInputNumberInlineEditingCancel | When | |
| calciteInputNumberInlineEditingChange | When | |
| calciteInputNumberInlineEditingConfirm | When | |
| calciteInputNumberInput | When |
Methods
| Name | Description | Signature |
|---|---|---|
| componentOnReady | Creates a promise that resolves once the component is fully loaded. | componentOnReady(): Promise<this> |
| selectText | Selects the text of the component's | selectText(): Promise<void> |
| setFocus | Sets focus on the component. | setFocus(options?: FocusOptions): Promise<void> |