HTML
A content area to embed HTML and CSS markup.
HTML supports most HTML tags and presentational attributes. Scripting is not supported but event handlers are available.
To embed web pages, use an IFrame component. For functionality that isn't available in other components, or to use React or HTML and JavaScript, use a Custom Component.
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.
clickable
Whether there is an enabled Click event handler.
Type | boolean |
Format | True/False |
Configurability | Inspector > Interaction > Event handlers |
Default |
|
Examples
true
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
Examples
query1
button1
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Show on desktop |
Default |
|
Examples
true
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Show on mobile |
Default |
|
Examples
true
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Maintain space when hidden |
Default |
|
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Configurability | Inspector > Spacing > Margin | |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
4px 8px
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Always show in edit mode |
Default |
|
Examples
true
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 |
---|---|
Change | The value is changed. |
Click | An item is clicked or pressed. |
To attach an event handler to a specific element in the HTML, add a data-<event type>-target
attribute. For example:
<button data-click-target="primary">Trigger event</button>