The Statistic component for Retool Apps
A content area to display primary and secondary number values with optional trend indicators.
For more information about this component, refer to the Informational components 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.
align
The horizontal alignment of the contents.
Type | string | ||||||||
Format | Plain Text | ||||||||
Mutability |
| ||||||||
Allowed Values |
| ||||||||
Default |
|
Examples
clickable
Whether there is an enabled Click event handler.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
currency
A three-letter ISO currency code to use if format
is currency
.
Type | string | ||||
Mutability |
|
decimalPlaces
The number of decimal places to display. If necessary, values round up or down automatically.
Type | number | ||||
Format | Integer | ||||
Mutability |
|
enableTrend
Whether to render the value using positive
or negative
color styles based on whether the secondary value is positive or negative.
Type | boolean | ||||
Mutability |
|
formattingStyle
The formatting style to use.
Type | string | ||||||||
Mutability |
| ||||||||
Allowed Values |
|
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
icon
the icon to display.
Type | string | ||||
Format | Icon Key | ||||
Mutability |
| ||||
Default |
|
Examples
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
label
The text label to display.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
labelCaption
The additional text to display with the label.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
|
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
padDecimal
Whether to include trailing zeros to match the specified value for decimalPlaces
.
Type | boolean | ||||
Mutability |
|
positiveTrend
Whether to display a positive trend for the secondary value.
Type | boolean |
Mutability | Read-only |
prefix
The prefix text to display.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
secondaryCurrency
The three-letter ISO currency code to use if format
is currency
.
Type | string | ||||
Mutability |
|
secondaryDecimalPlaces
The number of decimal places to display for the secondary value.
Type | number | ||||
Mutability |
|
secondaryEnableTrend
Whether to display the trend color for the secondary value.
Type | boolean | ||||
Mutability |
|
secondaryFormattingStyle
The formatting style for the secondary value.
Type | string | ||||||||
Mutability |
| ||||||||
Allowed Values |
|
secondaryPadDecimal
Whether to pad the secondary value with zeros.
Type | boolean | ||||
Mutability |
|
secondaryPositiveTrend
Whether to display a positive trend for the secondary value.
Type | boolean |
Mutability | Read-only |
secondaryPrefix
The prefix for the secondary value.
Type | string | ||||
Mutability |
|
secondaryShowSeparators
Whether to show separators for the secondary value.
Type | boolean | ||||
Mutability |
|
secondarySignDisplay
The sign display.
Type | string | ||||||||
Mutability |
| ||||||||
Allowed Values |
|
secondarySuffix
The suffix text to display.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
showSeparators
Whether the formatted value includes a localized thousands separator.
Type | boolean | ||||
Mutability |
|
signDisplay
The sign display.
Type | string | ||||||||
Mutability |
| ||||||||
Allowed Values |
|
style
Custom style options.
Type | object | ||||
Mutability |
|
suffix
The suffix text to display.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
statistic.resetValue()
Examples
statistic.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
statistic.scrollIntoView(options)
Parameters
Examples
statistic.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
statistic.setHidden(hidden)
Parameters
Examples
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 |
---|---|
Click | An item is clicked or pressed. |