Skip to main content

The Icon component for Retool Mobile

A content area to display an icon.

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.

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

icon

The icon to display if type is library.

Type string
Format Icon Key
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Icon
Default
null
Examples
/icon:bold/shopping-gift

svg

The SVG] markup to render if type is svg.

Type string
Mutability
ControlUsage
Retool UI Inspector

type

The icon type

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
library

Icon from the Retool icon library.

uri

Icon from a URL.

svg

Custom SVG.


url

The URL to the image to display if type is uri.

Type string
Mutability
ControlUsage
Retool UI Inspector
MethodopenUrl()

width

The width.

Type string
Format Integer
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
full

Full width.

fixed

Fixed width.

Examples
1280

widthPx

The width.

Type number
Format Integer
Mutability
ControlUsage
Retool UI Inspector
Examples
1280

Methods

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

icon.setHidden()

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

Definition
icon.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide icon.

icon.setHidden(true);

Unhide icon.

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