The Editable Number component for Retool Apps
A click-to-edit input field to enter a number.
Editable Number functions similarly to Number Input but renders as plain text until clicked.
For more information about using the Editable Number component, refer to the number inputs guide.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
allowNull
Whether to allow and validate a null
value instead of 0
if the input field is empty.
Type | boolean |
Format | True/False |
Configurability | Inspector > Interaction > Validation rules > Allow null |
Default |
|
Examples
true
currency
A three-letter ISO currency code to use if format
is currency
.
Type | string |
Configurability | Inspector |
decimalPlaces
The number of decimal places to display. If necessary, values round up or down automatically.
Type | number |
Format | Integer |
Configurability | Inspector > Content > Decimal places |
editIcon
The icon to display that indicates an editable value.
Type | string |
Format | Icon Key |
Configurability | Inspector > Content > Add-ons > Edit icon |
Default |
|
Examples
/icon:bold/interface-edit-write-1
events
A list of configured event handlers that trigger actions or queries.
Type | array |
Array values | object |
Configurability | Inspector > Interaction > Event handlers |
Array Object Properties
event
The event that triggers the action. Refer to the events section for details of available events for this object.
Type | string |
Configurability | Inspector > Interaction > Event handlers > Event |
method
The JavaScript method to perform when type
is datasource
, widget
, state
, or localStorage
.
Type | string |
Configurability | Inspector > Interaction > Event handlers > Edit event handler > Run script actions |
type
The type of action to perform.
Type | string | ||||||||||||||
Configurability | Inspector > Interaction > Event handlers > Edit event handler > Action | ||||||||||||||
Allowed Values |
|
format
The formatting style to use.
Type | string | ||||||||
Configurability | Inspector | ||||||||
Allowed Values |
|
iconAfter
The suffix icon to display.
Type | string |
Format | Icon Key |
Configurability | Inspector > Content > Add-ons > Suffix icon |
Default |
|
Examples
/icon:bold/shopping-gift
iconBefore
The prefix icon to display.
Type | string |
Format | Icon Key |
Configurability | Inspector > Content > Add-ons > Prefix icon |
Default |
|
Examples
/icon:bold/shopping-gift
id
The unique identifier (name).
Type | string |
Format | Plain Text |
Configurability | Inspector |
Default |
|
Examples
query1
button1
inputTooltip
The tooltip helper text to display below the input on focus.
Type | string |
Format | Plain Text |
Configurability | Inspector > Content > Add-ons > Helper text |
Default |
|
Examples
`Shift+Enter` to save, `Esc` to cancel
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Show on desktop |
Default |
|
Examples
true
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Show on mobile |
Default |
|
Examples
true
labelPosition
The position of the label relative to the input field or value.
Type | string | |||||||||
Format | Plain Text | |||||||||
Configurability | Inspector > Content > Add-ons > Label > Position | |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
top
loading
Whether to display a loading indicator.
Type | boolean |
Format | True/False |
Configurability | Inspector > Interaction > Loading |
Default |
|
Examples
true
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Maintain space when hidden |
Default |
|
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Configurability | Inspector > Spacing > Margin | |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
4px 8px
max
The maximum value to allow.
Type | number |
Configurability | Inspector > Interaction > Validation rules > Maximum |
min
The minimum value to allow.
Type | number |
Configurability | Inspector > Interaction > Validation rules > Minimum |
padDecimal
Whether to include trailing zeros to match the specified value for decimalPlaces
.
Type | boolean |
Configurability | Inspector |
placeholder
The text to display within the input field when there is no value.
Type | string |
Format | string |
Configurability | Inspector > Content > Placeholder |
Default |
|
Examples
Enter a value
readOnly
Whether user input is read-only.
Type | boolean |
Format | True/False |
Configurability | Inspector > Interaction > Advanced > Read only |
Default |
|
Examples
true
required
Whether a value is required to be selected.
Type | boolean |
Format | True/False |
Configurability | Inspector > Interaction > Validation rules > Required |
Default |
|
Examples
true
showClear
Whether to display a button to clear the value of the input field.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Show clear button |
Default |
|
Examples
true
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Always show in edit mode |
Default |
|
Examples
true
showSeparators
Whether the formatted value includes a localized thousands separator.
Type | boolean |
Configurability | Inspector > Appearance > Show thousands separator |
showStepper
Whether the input field includes buttons to adjust the value incrementally.
Type | boolean |
Configurability | Inspector > Appearance > Advanced > Show stepper buttons |
textAfter
The suffix text to display.
Type | string |
Format | Plain Text |
Configurability | Inspector > Content > Add-ons > Suffix text |
Default |
|
Examples
USD
px
@example.com
textAlign
The alignment of the text within the input field.
Type | string | ||||||||
Configurability | Read-only | ||||||||
Allowed Values |
|
textBefore
The prefix text to display.
Type | string |
Format | Plain Text |
Configurability | Inspector > Content > Add-ons > Prefix text |
Default |
|
Examples
$
Email address
SKU
tooltipText
The tooltip text to display next to the label on hover.
Type | string |
Format | Markdown |
Configurability | Inspector > Content > Add-ons > Helper text |
Default |
|
Examples
Submit
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
editableNumber.clearValidation()
Clear the validation message from the input field.
editableNumber.clearValidation()
Examples
Clear the validation message from editableNumber
.
editableNumber.clearValidation();
editableNumber.clearValue()
Clear the current values.
editableNumber.clearValue()
Examples
Clear the current value of editableNumber
.
editableNumber.clearValue();
editableNumber.focus()
Set focus on the input field.
editableNumber.focus()
Examples
Set focus on editableNumber
.
editableNumber.focus();
editableNumber.resetValue()
Reset the current value to the default value.
editableNumber.resetValue()
Examples
Reset the current value of editableNumber
.
editableNumber.resetValue();
editableNumber.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
editableNumber.scrollIntoView(options)
Parameters
Object Properties
behavior
The scroll behavior.
Type | string | ||||||
Allowed Values |
|
block
The scroll position relative to the component.
Type | string | ||||||||||
Allowed Values |
|
Examples
Scroll the minimum amount to immediately bring editableNumber
into view.
editableNumber.scrollIntoView({behavior: 'auto', block: 'nearest'});
editableNumber.setValue()
Set the current value.
editableNumber.setValue(key, value)
Examples
Set the current value of editableNumber
to userValue
.
editableNumber.setValue(userValue);
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
Blur | The input field is deselected. |
Change | The value is changed. |
Focus | The input field is selected. |