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 | ||||
Mutability |
| ||||
Default |
|
Examples
true
currentViewIndex
The index of the selected view.
Type | number |
Format | Integer |
Mutability | Read-only |
Default |
|
Examples
3
currentViewKey
The key value of the selected view.
Type | string |
Format | Plain Text |
Mutability | Read-only |
Default |
|
Examples
"view1"
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
disabledByIndex
A list of values for each item, by index, that reflect whether they are disabled.
Type | array |
Array values | boolean |
Mutability | Read-only |
Default |
|
Examples
[true, false, true]
enableFullBleed
Whether to expand the contents to fill available space.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
footerPadding
The amount of padding used within the footer.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
"8px 12px"
headerPadding
The amount of padding used within the header.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
"8px 12px"
hiddenByIndex
A list of items, by index, and whether they are hidden.
Type | array |
Array values | boolean |
Mutability | 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 | ||||
Mutability |
| ||||
Default |
|
Examples
true
hovered
Whether the component is currently hovered.
Type | boolean |
Format | True/False |
Mutability | Read-only |
Examples
true
iconByIndex
A list of icons for each item, by index.
Type | array |
Array values | string |
Mutability | 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 | ||||||
Mutability | Read-only | ||||||
Allowed Values |
|
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
query1
button1
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
itemMode
The configuration mode for container views. Always set to static
.
Type | string | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
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 |
Mutability | Read-only |
Default |
|
Examples
["Label 1", "Label 2", "Label 3"]
loading
Whether to display a loading indicator.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
4px 8px
padding
The amount of padding to render inside.
Type | string | ||||||
Format | Plain Text | ||||||
Mutability |
| ||||||
Allowed Values |
| ||||||
Default |
|
Examples
4px 8px
showBorder
Whether to show a border.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
showFooter
Whether to show the footer area.
Type | boolean | ||||||
Mutability |
|
showFooterBorder
Whether to show a border above the footer.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
|
Examples
true
showHeader
Whether to show the header area.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
showHeaderBorder
Whether to show a border under the header.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
style
Custom style options.
Type | object | ||||
Mutability |
|
tooltipByIndex
A list of tooltips for each item, by index.
Type | array |
Array values | string |
Mutability | Read-only |
Default |
|
Examples
["Tooltip 1", "Tooltip 2"]
tooltipText
The tooltip text to display next to the label on hover.
Type | string | ||||
Format | Markdown | ||||
Mutability |
| ||||
Default |
|
Examples
Submit
transition
The transition animation used when switching views.
Type | string | ||||||||
Mutability | Read-only | ||||||||
Allowed Values |
|
views
A list of views configured for the container.
Type | array |
Array values | object |
Mutability | Read-only |
Array Object Properties
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
icon
The prefix icon to display.
Type | string | ||||
Format | Icon Key | ||||
Mutability |
| ||||
Default |
|
Examples
/icon:bold/shopping-gift
iconPosition
The position of the icon relative to the text.
Type | string | ||||||||||||
Format | Plain Text | ||||||||||||
Mutability |
| ||||||||||||
Allowed Values |
| ||||||||||||
Default |
|
Examples
left
label
The text label to display.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
"Label"
tooltip
The tooltip text to display next to the label on hover.
Type | string | ||||
Format | Markdown | ||||
Mutability |
|
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. |