Skip to main content

The Button component for Retool Mobile

A button to trigger actions when clicked.

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.

disabled

Whether input, interaction, selection, or triggering is disabled.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Interaction
MethodsetDisabled()
Default
false
Examples
true

hidden

Whether this object is hidden from view.

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

iconAfter

The suffix icon to display.

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

iconBefore

The prefix icon to display.

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

loading

Whether to display a loading indicator.

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

size

The size.

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
default

The default size.

small

The smallest size.


submit

Whether to submit using the submitTargetId property when clicked.

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

submitTargetId

The form to submit when the submit property is true.

Type string
Format Retool object name
Mutability Read-only
Default
null
Examples
form1

text

The primary text content.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons
Default
Button
Examples
Submit

type

The type of content or action to perform.

Type string
Mutability
ControlUsage
Retool UI Inspector

width

The width.

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

Full width.

fixed

Fixed width.

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.

button.setDisabled()

Set the disabled value to toggle whether the input field is disabled. Defaults to true without a parameter.

Definition
button.setDisabled(disabled)
Parameters

disabled

boolean

Whether input, interaction, selection, or triggering is disabled.

Examples

Disable button.

button.setDisabled(true);

Enable button.

button.setDisabled(false);

button.setHidden()

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

Definition
button.setHidden(hidden)
Parameters

hidden

boolean

Whether this object is hidden from view.

Examples

Hide button.

button.setHidden(true);

Unhide button.

button.setHidden(false);

Events

Events triggered by user interactions. Use event handlers to trigger queries or other actions in response to events.

click

An item is clicked or pressed.