The Container component for Retool Mobile
A container to group other components.
Settings
Container includes the following configurable options when building apps in the IDE.
Show on desktopShow on mobileMaintain space when hiddenMarginAlways show in edit modeStyles |
Properties
All properties for Container with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
Values
left | Left alignment. |
center | Center alignment. |
right | Right alignment. |
collapsedIcon
The icon that's displayed when collapsed.
collapsible
Whether collapsible add-ons are configured.
cornerType
The corner style to use.
Values
square | Square corners. |
round | Rounded corners. |
Values
none | No elevated style. |
raised | Raised elevated style. |
Properties
event
The event type.
Values
change | A user changes the value. |
click | A user clicks or taps the component. |
submit | A user submits the value. |
focus | A user selects the input field. |
blur | A user deselects the input field. |
scan | A user scans a barcode. |
open | A user opens the component. |
close | A user closes the component. |
true | A user sets the value to |
false | A user sets the value to |
select | A user selects a value. |
clear | A user clears the value. |
upload | A user uploads a file. |
parse | An uploaded file is parsed. |
inputValueChange | A user changes the value of the input field. |
method
The JavaScript method to perform when type
is datasource
, widget
, state
, or localStorage
.
Values
datasource | Control query. |
widget | Control component. |
script | Run script. |
state | Set variable. |
localStorage | Set localStorage. |
util | Perform utility action (e.g., Open URL or Confetti). |
expandedIcon
The icon that's displayed when expanded.
global
Whether the object is globally scoped for use in all app pages.
id
The unique identifier.
isHiddenOnDesktop
Whether the component is visible in the desktop layout.
isHiddenOnMobile
Whether the component is visible in the mobile layout.
Values
left | Left alignment. |
center | Center alignment. |
right | Right alignment. |
stretched | Justified alignment |
maintainSpaceWhenHidden
Whether the component takes up space on the canvas if hidden
is true
.
padding
The amount of padding to render inside.
pluginType
The plugin type.
showBorder
Whether to show a border.
showInEditor
Whether to remain visible in the editor if hidden
is true
.
title
The text to display as a title.
widthGrowFactor
Sets the width grow factor of a width item's main width size, similar to the flex-grow
CSS property.
Methods
JavaScript API methods for interacting with Container. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
setHidden
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
container.setHidden(hidden)
Parameters
Events
Events are triggered by user interactions, such as clicking a button or entering a value. Use event handlers to trigger queries or other actions in response to events.
click
The item is clicked or pressed.