The Stack component for Retool Apps
A container to group other components together in a flexbox layout.
For more information about using the Stack component, refer to the containers 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.
clickable
Whether there is an enabled Click event handler.
Type | boolean |
Format | True/False |
Configurability | Inspector > Interaction > Event handlers |
Default | false |
Examples
true
currentViewIndex
The index of the selected view.
Type | number |
Format | Integer |
Configurability | Read-only |
Default | null |
Examples
3
currentViewKey
The key value of the selected view.
Type | string |
Format | Plain Text |
Configurability | Read-only |
Default | null |
Examples
"view1"
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean |
Format | True/False |
Configurability | Inspector > Interaction > Disabled |
Default | false |
Examples
true
disabledByIndex
A list of values for each item, by index, that reflect whether they are disabled.
Type | array |
Array values | boolean |
Configurability | Read-only |
Default | [] |
Examples
[true, false, true]
enableFullBleed
Whether to expand the contents to fill available space.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Expand contents to fit |
Default | false |
Examples
true
events
A list of configured event handlers that trigger actions or queries.
Type | array |
Array values | object |
Configurability | Inspector > Interaction > Event handlers |
Default | null |
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 |
Default | null |
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 |
Default | null |
type
The type of action to perform.
Type | string | ||||||||||||||
Configurability | Inspector > Interaction > Event handlers > Edit event handler > Action | ||||||||||||||
Allowed Values |
| ||||||||||||||
Default | null |
footerPadding
The amount of padding used within the footer.
Type | string | |||||||||
Format | Plain Text | |||||||||
Configurability | Inspector > Content > Add-ons > Footer > Padding | |||||||||
Allowed Values |
| |||||||||
Default | 8px 12px |
Examples
"8px 12px"
headerPadding
The amount of padding used within the header.
Type | string | |||||||||
Format | Plain Text | |||||||||
Configurability | Inspector > Content > Add-ons > Header > Padding | |||||||||
Allowed Values |
| |||||||||
Default | 8px 12px |
Examples
"8px 12px"
hiddenByIndex
A list of items, by index, and whether they are hidden.
Type | array |
Array values | boolean |
Configurability | Read-only |
Default | [] |
Examples
[true, false, true]
hoistFetching
Whether to display a loading indicator whenever nested objects are fetching data.
Type | boolean |
Format | True/False |
Configurability | Inspector > Interaction > Hoist loading state |
Default | false |
Examples
true
hovered
Whether the component is currently hovered.
Type | boolean |
Format | True/False |
Configurability | Read-only |
Default | null |
Examples
true
iconByIndex
A list of icons for each item, by index.
Type | array |
Array values | string |
Configurability | Read-only |
Default | [] |
Examples
["/icon:bold/shopping-gift", "/icon:bold/interface-user-single", "/icon:bold/interface-align-layers-1"]
iconPositionByIndex
A list of icon positions for each item, by index, relative to labels.
Type | array | ||||||
Array values | string | ||||||
Configurability | Read-only | ||||||
Allowed Values |
| ||||||
Default | null |
Examples
query1
button1
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 | false |
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 | true |
Examples
true
itemMode
The configuration mode for container views. Always set to static
.
Type | string | |||||||||
Configurability | Inspector > Content > null | |||||||||
Allowed Values |
| |||||||||
Default | static |
Examples
"dynamic"
labels
A list of labels for each item. Falls back to the corresponding value
if no label is provided.
Type | array |
Array values | string |
Configurability | Read-only |
Default | [] |
Examples
["Label 1", "Label 2", "Label 3"]
loading
Whether to display a loading indicator.
Type | boolean |
Format | True/False |
Configurability | Inspector > Interaction > Loading |
Default | false |
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 | false |
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Configurability | Inspector > Spacing > Margin | |||||||||
Allowed Values |
| |||||||||
Default | 4px 8px |
Examples
4px 8px
padding
The amount of padding to render inside.
Type | string | ||||||
Format | Plain Text | ||||||
Configurability | Inspector > Spacing > Padding | ||||||
Allowed Values |
| ||||||
Default | 4px 8px |
Examples
4px 8px
showBorder
Whether to show a border.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Show border |
Default | false |
Examples
true
showFooterBorder
Whether to show a border above the footer.
Type | boolean |
Format | True/False |
Configurability | Inspector > Content > Add-ons > Footer > Appearance > Show separator |
Default | null |
Examples
true
showHeader
Whether to show the header area.
Type | boolean |
Format | True/False |
Configurability | Inspector > Content > Add-ons > Header > Appearance > Show header |
Default | false |
Examples
true
showHeaderBorder
Whether to show a border under the header.
Type | boolean |
Format | True/False |
Configurability | Inspector > Content > Add-ons > Header > Appearance > Show separator |
Default | true |
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 | false |
Examples
true
tooltipByIndex
A list of tooltips for each item, by index.
Type | array |
Array values | string |
Configurability | Read-only |
Default | [] |
Examples
["Tooltip 1", "Tooltip 2"]
tooltipText
The tooltip text to display next to the label on hover.
Type | string |
Format | Markdown |
Configurability | Inspector > Content > Add-ons > Helper text |
Default | null |
Examples
Submit
transition
The transition animation used when switching views.
Type | string | ||||||||
Configurability | Read-only | ||||||||
Allowed Values |
| ||||||||
Default | null |
views
A list of views configured for the container.
Type | array |
Array values | object |
Configurability | Read-only |
Default | null |
Array Object Properties
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean |
Format | True/False |
Configurability | Inspector > Interaction > Disabled |
Default | false |
Examples
true
hidden
Whether this object is hidden from view.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Hidden |
Default | false |
Examples
true
icon
The prefix icon to display.
Type | string |
Format | Icon Key |
Configurability | Inspector > Content > Add-ons > Prefix icon |
Default | null |
Examples
/icon:bold/shopping-gift
iconPosition
The position of the icon relative to the text.
Type | string | ||||||||||||
Format | Plain Text | ||||||||||||
Configurability | Inspector > Content > Add-ons > Icon position | ||||||||||||
Allowed Values |
| ||||||||||||
Default | left |
Examples
left
label
The text label to display.
Type | string |
Format | Plain Text |
Configurability | Inspector > Content > Add-ons > Label > Label |
Default | null |
Examples
"Label"
tooltip
The tooltip text to display next to the label on hover.
Type | string |
Format | Markdown |
Configurability | Inspector > Content > Add-ons > Tooltip |
Default | null |
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
stack.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
stack.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 stack
into view.
stack.scrollIntoView({behavior: 'auto', block: 'nearest'});
stack.setCurrentView(key)
Examples
Set the current view of stack
to userView
.
stack.setCurrentView(userView);
stack.setCurrentViewIndex(index)
Examples
Set the current view of stack
to index 1
.
stack.setCurrentViewIndex(1);
stack.setDisabled()
Set the disabled
value to toggle whether the input field is disabled. Defaults to true
without a parameter.
stack.setDisabled(disabled)
Parameters
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean |
Format | True/False |
Default |
|
Examples
true
Examples
Disable stack
.
stack.setDisabled(true);
Enable stack
.
stack.setDisabled(false);
stack.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
stack.setHidden(hidden)
Parameters
Examples
true
Examples
Hide stack
.
stack.setHidden(true);
Unhide stack
.
stack.setHidden(false);
stack.setShowBody(showBody)
Examples
Show the body of stack
.
stack.setShowBody(true);
Hide the body of stack
.
stack.setShowBody(false);
stack.setShowFooter(showFooter)
Examples
Show the footer of stack
.
stack.setShowFooter(true);
Hide the footer of stack
.
stack.setShowFooter(false);
stack.setShowHeader(showHeader)
Parameters
Examples
true
Examples
Show the header of stack
.
stack.setShowHeader(true);
Hide the header of stack
.
stack.setShowHeader(false);
stack.showNextVisibleView()
stack.showPreviousVisibleView()
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 |
---|---|
Change | The value is changed. |
Click | An item is clicked or pressed. |