The Image component for Retool Mobile
A content area to display an image.
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.
cornerType
The corner style to use.
Type | string | ||||||||
Configurability | Inspector | ||||||||
Allowed Values |
|
dbBlobId
Self-hosted Retool deployments only. The ID of the uploaded image when srcType
is dbBlobId
.
Type | string |
Configurability | Read-only |
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 |
|
hidden
Whether this object is hidden from view.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Hidden |
Default |
|
Examples
true
mode
How to render images to fit.
Type | string | ||||||||||
Configurability | Inspector | ||||||||||
Allowed Values |
|
ratio
The ratio of width-to-height.
Type | string | ||||||||||
Configurability | Inspector | ||||||||||
Allowed Values |
|
retoolFileObject
The file's data when using a file not stored in Retool Storage.
Type | object |
Configurability | Read-only |
Object Properties
Examples
{
"name": "sample.pdf",
"type": "application/pdf",
"sizeBytes": 10523,
"base64Data": "JVBERi0xLjQKJeLjz9...G"
}
retoolStorageDynamicInput
Whether retoolStorageFileId
is set dynamically.
Type | string |
Configurability | Read-only |
retoolStorageFileId
The unique identifier for a file in Retool Storage.
Type | string |
Format | UUID |
Configurability | Inspector > Content > File input |
Examples
https://upload.wikimedia.org/wikipedia/commons/1/14/Marspathfinder.pdf
srcType
The source type.
Type | string | ||||||||||||
Configurability | Inspector | ||||||||||||
Allowed Values |
|
storageBlobId
The ID of the uploaded image when srcType
is storageBlobId
.
Type | string |
Format | Blob URI |
Configurability | Read-only |
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
image.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
image.setHidden(hidden)
Parameters
Examples
true
Examples
Hide image
.
image.setHidden(true);
Unhide image
.
image.setHidden(false);
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. |