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.
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.
allowCamera
Whether to allow access to a connected camera.
allowDownloads
Whether to allow downloads.
allowForms
Whether to allow form submissions.
allowFullscreen
Whether to allow fullscreen mode.
allowGeolocation
Whether to allow access to the user's location.
allowMicrophone
Whether to allow access to the microphone.
allowModals
Whether to allow modals.
allowPayment
allowPopups
Whether to allow popups.
allowSameOrigin
Whether to allow content to be treated as being from the same origin.
allowTopNavigation
Whether to allow navigation away from the app.
global
Whether the object is globally scoped for use in all app pages.
Whether the component is visible.
id
The unique identifier.
isHiddenOnDesktop
Whether the component is visible in the desktop layout.
isHiddenOnMobile
Whether the component is visible in the mobile layout.
maintainSpaceWhenHidden
Whether the component takes up space on the canvas if hidden
is true
.
pluginType
The plugin type.
showInEditor
Whether to remain visible in the editor if hidden
is true
.
showTopBar
Whether to display a toolbar.
title
The text to display as a title.
tooltipText
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
The scroll options.
Properties
behavior
The scroll behavior.
Values
auto | Scroll immediately to the specified position. |
smooth | Scroll gradually to the specified position. |
block
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
Whether the component is visible.
setPageUrl
Set the URL of the current page.