Skip to main content

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
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
square

Square corners.

round

Rounded corners.

circle

Circular corners.


dbBlobId

Self-hosted Retool deployments only. The ID of the uploaded image when srcType is dbBlobId.

Type string
Mutability Read-only

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Hidden
MethodsetHidden()
Default
false
Examples
true

mode

How to render images to fit.

Type string
Mutability
ControlUsage
Retool UI Inspector
MethodsetMode()
Allowed Values
ValueDescription
cover

Scale the image to fit the area while preserving the aspect ratio.

center

Center the image.

stretch

Resize the image to the same dimensions as the area.

contain

Scale and clip the image to fit the area while preserving the aspect ratio.


ratio

The ratio of width-to-height.

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
2

2:1 ratio.

1.3333333333333333

4:3 ratio.

1

1:1 ratio.

0.75

3:4 ratio.


retoolFileObject

The file's data when using a file not stored in Retool Storage.

Type object
Mutability Read-only

retoolStorageDynamicInput

Whether retoolStorageFileId is set dynamically.

Type string
Mutability Read-only

retoolStorageFileId

The Retool Storage file ID if srcType is retoolStorageFileId.

Type string
Mutability
ControlUsage
Retool UI Inspector

src

The data source.

Type string
Mutability
ControlUsage
Retool UI Inspector
MethodsetFileUrl()

srcType

The source type.

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
src

URL.

retoolStorageFileId

Retool Storage file.

retoolFileObject

Retool file object.

dbBlobId

Database blob.

storageBlobId

Storage blob.


storageBlobId

The ID of the uploaded image when srcType is storageBlobId.

Type string
Format Blob URI
Mutability 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.

Definition
image.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
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.

EventDescription
ClickAn item is clicked or pressed.