Skip to main content

The Image Grid component for Retool Apps

A content area to display images in a grid layout.

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.

aspectRatio

The ratio of width-to-height (e.g., 1.3 to use 4:3 ratio).

Type number
Format Float
Mutability
ControlUsage
Retool UI Inspector
Examples
1.3

captionByIndex

A list of captions for each item, by index.

Type array
Format Plain Text
Array values string
Mutability Read-only
Default
[]
Examples
["Caption 1", "Caption 2"]

clickable

Whether there is an enabled Click event handler.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Interaction > Event handlers
Default
false
Examples
true

clickableByIndex

A list of boolean values for each item, by index, that reflect whether they have an enabled Click event handler.

Type array
Array values boolean
Mutability Read-only

columnCount

The number of columns to display.

Type number
Mutability
ControlUsage
Retool UI Inspector

columnMinWidth

The minimum width of each column if columnType is responsive.

Type number
Mutability
ControlUsage
Retool UI Inspector

columnType

The type of columns to display.

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
fixed

Fixed width.

responsive

Responsive width.


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]

id

The unique identifier (name).

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector
Default
imageGrid1
Examples
query1
button1

isHiddenOnDesktop

Whether to show or hide this object in the desktop layout.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI 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
Mutability
ControlUsage
Retool UI Inspector > Appearance > Advanced > Show on mobile
Default
true
Examples
true

maintainSpaceWhenHidden

Whether to take up space on the canvas if hidden is true.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Advanced > Maintain space when hidden
Default
false
Examples
true

margin

The amount of margin to render outside.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Spacing > Margin
Allowed Values
ValueUI OptionDescription
4px 8pxNormal

Normal margin.

0None

No margin.

Default
4px 8px
Examples
4px 8px

showInEditor

Whether the component remains visible in the editor if hidden is true.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Advanced > Always show in edit mode
Default
false
Examples
true

srcByIndex

A list of image URLs, by index.

Type array
Array values string
Mutability Read-only

style

Custom style options.

Type object
Mutability
ControlUsage
Retool UI Inspector > Appearance > style

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
ControlUsage
Retool UI Inspector > Content > Add-ons > Helper text
Default
null
Examples
Submit

Methods

JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

imageGrid.setHidden()

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

Definition
imageGrid.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide imageGrid.

imageGrid.setHidden(true);

Unhide imageGrid.

imageGrid.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.