HTML

A container for custom HTML and CSS code. Supports most HTML tags and presentational attributes, but only supports scripting in a limited capacity (see Event Handling section)'.

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

Available properties for HTML with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read information about components.

NameTypeDescriptionclickableboolean

Whether the component has an enabled Click event handler.

cssstring

The CSS to style the rendered HTML.

hiddenboolean

Whether the component is visible.

htmlstring

The HTML to render.

maintainSpaceWhenHiddenboolean

Whether the component takes up space on the canvas if hidden is true.

marginstring

The amount of margin to render outside of the component.

showInEditorboolean

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

tooltipTextstring

The text to display in a tooltip on hover or focus.

Events

Events are triggered by user interactions with HTML. Use event handling to trigger queries or other actions in response to events.

NameDescriptionClick

A user clicks the component.

Change

A user changes the current value.

Methods

Methods for interacting with HTML. You can write JavaScript almost anywhere in Retool and use methods to manipulate data or components.

NameDescriptionscrollIntoView(options: any)

Scrolls the canvas or parent container so that the selected component appears in the visible area.

setHidden(hidden: boolean)

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