Skip to main content

IFrame

A content area to embed a web page.

IFrame supports permissions to allow or deny downloads, form submissions, microphone and camera access, and popups.

Use a HTML component to include custom HTML and CSS instead of an embedded web page. You can also use a Custom Component to include custom React, HTML, and JavaScript.

Settings

IFrame includes the following configurable options when building apps in the IDE.

Allow cameraAllow downloadsAllow form submissionsAllow fullscreenAllow geolocationAllow microphoneAllow modalsAllow popupsAllow same originAllow top navigationShow on desktopShow on mobileMaintain space when hiddenMarginAlways show in edit modeShow top barSourceStylesHelper text

Properties

All properties for IFrame with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.

Whether to allow access to a connected camera.


Whether to allow downloads.


Whether to allow form submissions.


Whether to allow fullscreen mode.


Whether to allow access to the user's location.


Whether to allow access to the microphone.


Whether to allow modals.


allowPayment


Whether to allow popups.


Whether to allow content to be treated as being from the same origin.


Whether to allow navigation away from the app.


global

boolean

Whether the object is globally scoped for use in all app pages.


boolean

Whether the component is visible.


id

string

The unique identifier.


Whether the component is visible in the desktop layout.


Whether the component is visible in the mobile layout.


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


The amount of margin to render outside.

Values
4px 8px

Normal margin.

0

No margin.


pluginType

string

The plugin type.


Whether to remain visible in the editor if hidden is true.


Whether to display a toolbar.


src

string

The data source.


style

object

Custom style options in use. Not all style options may be available for all components.


title

string

The text to display as a title.


The tooltip text to display.


Methods

JavaScript API methods for interacting with IFrame. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

reload

Reload the component.

iFrame.reload()

scrollIntoView

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

iFrame.scrollIntoView(scrollIntoViewOptions)
Parameters

scrollIntoViewOptions

object

The scroll options.

Properties

behavior

enum

The scroll behavior.

Values
auto

Scroll immediately to the specified position.

smooth

Scroll gradually to the specified position.


block

enum

The scroll position relative to the component.

Values
nearest

Scrolls only the minimum amount required for the component to appear in the visible area. Scrolling does not occur if the component is already in view.

start

Scrolls to position the component at the top of the visible area.

center

Scrolls to position the component in the middle of the visible area.

end

Scrolls to position the component at the bottom of the visible area.




setHidden

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

iFrame.setHidden(hidden)
Parameters

boolean

Whether the component is visible.



setPageUrl

Set the URL of the current page.

iFrame.setPageUrl(src)
Parameters

src

string

The data source.