Learn about the NumberInput component for use in UI extensions.
NumberInput
component renders a number input field. Commonly used within the Form component.
Prop | Type | Description |
---|---|---|
name | String | The input’s unique identifier. |
label | String | The text that displays above the dropdown menu. |
value | String | number | The value of the input. |
defaultValue | Number | The value of the input on initial render. |
description | String | Text that describes the field’s purpose. |
required | Boolean | When set to true , displays a required field indicator. |
readOnly | Boolean | When set to true , users will not be able to enter a value into the field. Set to false by default. |
placeholder | String | The text that appears in the input before a value is set. |
tooltip | String | The text that displays in a tooltip next to the label. |
error | Boolean | When set to true , validationMessage is displayed as an error message if provided. The input will also render its error state to let the user know there’s an error. When false (default), validationMessage is displayed as a success message. |
validationMessage | String | The text to display if the input has an error. |
min | Number | Sets the lower bound of the input. |
max | Number | Sets the upper bound of the input. |
precision | Number | Sets the number of digits to the right of the decimal point. |
formatStyle | 'decimal' | 'percentage' | Formats the input as a decimal or percentage. |
onBlur | (value: number) => void | A function that is called every time the field loses focus, passing the value. |
onChange | (value: number) => void | A callback function that is invoked when the value is committed. Currently these times are onBlur of the input and when the user submits the form. |
onFocus | (value: number) => void | A function that is called every time the field gets focused on, passing the value. |