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 an 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.
For more information about using the IFrame component, refer to the iframes guide.
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.
showTopBar
Whether to display a toolbar.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
src
The data source.
Type | string | ||||||
Format | string | ||||||
Mutability |
|
Examples
https://upload.wikimedia.org/wikipedia/commons/1/14/Marspathfinder.pdf
style
Custom style options.
Type | object | ||||
Mutability |
|
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
iFrame.reload()
Examples
Reload iFrame
.
iFrame.reload();
iFrame.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
iFrame.scrollIntoView(options)
Parameters
Object Properties
behavior
The scroll behavior.
Type | string | ||||||
Allowed Values |
|
block
The scroll position relative to the component.
Type | string | ||||||||||
Allowed Values |
|
Examples
Scroll the minimum amount to immediately bring iFrame
into view.
iFrame.scrollIntoView({behavior: 'auto', block: 'nearest'});
iFrame.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
iFrame.setHidden(hidden)
Parameters
Examples
true
Examples
Hide iFrame
.
iFrame.setHidden(true);
Unhide iFrame
.
iFrame.setHidden(false);
iFrame.setPageUrl(url)