Sizing of an iFrame.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2024 10:15 AM
I am trying to load contents in an iFrame, from a third-party source. The iFrame component I am using is in UI Builder. I want the size of the iFrame to be based on the contents it loaded and should be adjusted to the size of screen as well. The current sizing allows the size to be altered statically. How can I achieve this in UI builder?
- Labels:
-
UI Builder : Next Experience

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2024 01:38 PM
The iframe component won't support resizing based on the contents.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2024 02:23 PM
Hi Brad,
Thanks for your response!
Is there any way I could change the height of the iFrame using a script, rather than giving the height statically. Even if it is not resized based on contents, I still want it to be resized based on the screen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2024 07:50 PM
I wonder do you simply want to set the height of it to 100%? So here I am setting the height of the "body" to 100%
and then I am doing the same in the iframe:
You could set the Height param to a state variable too, something like @STate.iframeHeight, but I am not sure what value you could dynamically assign to it, so perhaps just setting 100% is enough? 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2024 08:06 AM
Hi Kevin,
Thank you for your response!
I tried binding it with a state parameter but could not achieve that dynamically. I see there is an option to set the height using script. For other applications I have used method window.innerHeight to set the height of iFrame. But, I am not sure how to configure that in UI builder as I am very new to it. Any suggestions for that would be really helpful.