# Dynamic Size for popup

**URL:** <https://forum.inductiveautomation.com/t/dynamic-size-for-popup/112787>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [December 12, 2025, 2:36pm UTC](https://forum.inductiveautomation.com/t/dynamic-size-for-popup/112787 "2025-12-12T14:36:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexandernoahfoster9](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@alexandernoahfoster9](https://forum.inductiveautomation.com/u/alexandernoahfoster9)\
**Post date:** [December 12, 2025, 2:36pm UTC](https://forum.inductiveautomation.com/t/dynamic-size-for-popup/112787/1 "2025-12-12T14:36:15Z")

</div>

I am wondering if there is a way to determine the size of the viewport so that I can dynamically size a popup through scripting. I want it to change sizes depending on if the user is on mobile, or tablet or desktop.

---

<div class="post-metadata">

**Author:** ![alexandernoahfoster9](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@alexandernoahfoster9](https://forum.inductiveautomation.com/u/alexandernoahfoster9)\
**Post date:** [December 12, 2025, 2:44pm UTC](https://forum.inductiveautomation.com/t/dynamic-size-for-popup/112787/2 "2025-12-12T14:44:05Z")

</div>

I have just found that you can set the default width of the popup to auto (even though it shows an error) and same with the height. Seems to have solved my problem

---

<div class="post-metadata">

**Author:** ![Nol](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@Nol](https://forum.inductiveautomation.com/u/Nol)\
**Post date:** [December 12, 2025, 3:39pm UTC](https://forum.inductiveautomation.com/t/dynamic-size-for-popup/112787/3 "2025-12-12T15:39:53Z")

</div>

When you launch the popup there is a field for position which lets you specify the height and width of it. You could link this to the screen size if you wanted to.

> **[system.perspective.openPopup | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-openPopup)**
>
> Open a popup view over the given page.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 12, 2025, 3:45pm UTC](https://forum.inductiveautomation.com/t/dynamic-size-for-popup/112787/4 "2025-12-12T15:45:04Z")

</div>

> [@Nol](#):
>
> You could link this to the screen size if you wanted to.

The issue here is if the screen size changes, like if the phone goes from portrait to landscape, fixing the width won’t auto adjust the popup size. I’ve suggest before that you can set the min and max width props of the popup that seemed to work, although there were some potentially weird things I found later that i hadn’t ironed out..

> [@Popup view in mobile phone](https://forum.inductiveautomation.com/t/popup-view-in-mobile-phone/112550/2):
>
> Adding this to the stylesheet this seems to work. You’ll need to play with it and check it more thoroughly than I have and see if it break anything… .popup-body \> .view { min-width: 0vw !important; max-width: 95vw !important; } you’ll need to do something similar for the height

---

<div class="post-metadata">

**Author:** ![alexandernoahfoster9](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@alexandernoahfoster9](https://forum.inductiveautomation.com/u/alexandernoahfoster9)\
**Post date:** [December 12, 2025, 4:04pm UTC](https://forum.inductiveautomation.com/t/dynamic-size-for-popup/112787/5 "2025-12-12T16:04:45Z")

</div>

Would I add that to the advanced stylesheet?

---

<div class="post-metadata">

**Author:** ![alexandernoahfoster9](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@alexandernoahfoster9](https://forum.inductiveautomation.com/u/alexandernoahfoster9)\
**Post date:** [December 12, 2025, 4:08pm UTC](https://forum.inductiveautomation.com/t/dynamic-size-for-popup/112787/6 "2025-12-12T16:08:13Z")

</div>

I have played around with creating a position fixed container over top of the view itself and making my own modal popup, but it would just be easier to get the built in popup to work similarly so that it is easier to produce in mass.
