# Is there a way to resize plugin window via JS?

**URL:** <https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633>\
**Category:** UXP Plugin API\
**Created:** [December 29, 2022, 1:15am UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633 "2022-12-29T01:15:02Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![photonic](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/photonic/32/2513_2.png) [@photonic](https://forums.creativeclouddeveloper.com/u/photonic)\
**Post date:** [December 29, 2022, 1:15am UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/1 "2022-12-29T01:15:02Z")

</div>

I’m trying to find a way to resize my plugin window in UXP?

With CEP I used to use:

```auto
csInterface.resizeContent(width, height);

```

Is there something similar in UXP?

Thanks!

Mario OM

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [December 29, 2022, 7:39am UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/2 "2022-12-29T07:39:09Z")

</div>

It was already asked and it seems no update

> [@Plugin resize via JS](http://forums.creativeclouddeveloper.com/t/plugin-resize-via-js/2834/2):
>
> UXP does not currently have any mechanism for controlling the size of the panels dynamically.

---

<div class="post-metadata">

**Author:** ![photonic](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/photonic/32/2513_2.png) [@photonic](https://forums.creativeclouddeveloper.com/u/photonic)\
**Post date:** [December 29, 2022, 8:44pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/3 "2022-12-29T20:44:35Z")

</div>

This is something that should be implemented.

---

<div class="post-metadata">

**Author:** ![svumme](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/svumme/32/1289_2.png) [@svumme](https://forums.creativeclouddeveloper.com/u/svumme)\
**Post date:** [May 28, 2024, 12:01pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/4 "2024-05-28T12:01:12Z")

</div>

Hi @indranil, Is there any plan to introduce the feature for dynamic resizing of panel windows via code in future versions of the UXP platform? This capability would be very useful for creating more flexible and adaptable interfaces.

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [May 28, 2024, 12:38pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/5 "2024-05-28T12:38:45Z")

</div>

TBH, unless there’s an option to turn off auto-resize, I would not want this. Usually I dock panels somewhere and resize would create a mess 😕

---

<div class="post-metadata">

**Author:** ![svumme](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/svumme/32/1289_2.png) [@svumme](https://forums.creativeclouddeveloper.com/u/svumme)\
**Post date:** [May 28, 2024, 12:42pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/6 "2024-05-28T12:42:54Z")

</div>

hi @Karmalakas  
By dynamic, I mean the ability to programmatically change the dimensions of the panel.

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [May 28, 2024, 12:59pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/7 "2024-05-28T12:59:12Z")

</div>

> [@svumme](#):
>
> I mean the ability to programmatically change the dimensions of the panel

Yes, I understand 🙂 When I dock the panel, I usually adjust the size manually to place it where and how I wish, to make my workflow comfortable and consistent. If panel would get resized depending on some of my actions (or worse - depending on some actions, that developer decides), that would ruin the layout I’ve set up, thus ruining my usual workflow to reach the panels. In these cases I don’t mind having scrollbars, but the size should not change.

IMO, if panel requires a size change, maybe the design (not necessary visual) is flawed. Maybe there should be some dialog or maybe even a completely separate panel with different interface 🤔

I wonder what the use cases would be for actually justifiable panel size change without user actually changing the size manually

---

<div class="post-metadata">

**Author:** ![svumme](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/svumme/32/1289_2.png) [@svumme](https://forums.creativeclouddeveloper.com/u/svumme)\
**Post date:** [May 28, 2024, 1:17pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/8 "2024-05-28T13:17:46Z")

</div>

I simply think it should be an additional feature so that if you don’t like it, you simply don’t use it and continue resizing your panel manually. I am creating widgets for color grading like curves, horizontal curves, vectorscope, etc. There are cases where I want to dynamically resize the panel to optimize space or to see them larger. Many software programs allow dynamic resizing of their panels.

---

<div class="post-metadata">

**Author:** ![PS-fxrios](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ps-fxrios/32/2461_2.png) [@PS-fxrios](https://forums.creativeclouddeveloper.com/u/PS-fxrios)\
**Post date:** [May 28, 2024, 2:27pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/9 "2024-05-28T14:27:13Z")

</div>

> [@svumme](#):
>
> redimensionar dinamicamente

I would love to be able to also dynamically resize a Modal window with it open. @svumme this feature would be a great option.

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [May 28, 2024, 3:29pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/10 "2024-05-28T15:29:19Z")

</div>

> [@svumme](#):
>
> curves, horizontal curves, vectorscope

Oh, I would be interested in those, but I’d love to have them in separate panels freely resizeable so I could have curves and vectorscope open at the same time

---

<div class="post-metadata">

**Author:** ![indranil](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/indranil/32/2584_2.png) [@indranil](https://forums.creativeclouddeveloper.com/u/indranil)\
**Post date:** [May 30, 2024, 4:32pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/11 "2024-05-30T16:32:53Z")

</div>

Hello @svumme, this feature is there in our backlog but not planned for this year. On a related note, would a resizable window/dialog work for your use case?

---

<div class="post-metadata">

**Author:** ![PS-fxrios](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ps-fxrios/32/2461_2.png) [@PS-fxrios](https://forums.creativeclouddeveloper.com/u/PS-fxrios)\
**Post date:** [May 30, 2024, 8:43pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/12 "2024-05-30T20:43:07Z")

</div>

@indranil Can a window/dialog box resize with a click event on it?If yes, could you please share the JS logic? I’m not sure, but I don’t think this is documented

---

<div class="post-metadata">

**Author:** ![svumme](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/svumme/32/1289_2.png) [@svumme](https://forums.creativeclouddeveloper.com/u/svumme)\
**Post date:** [June 3, 2024, 9:46pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/13 "2024-06-03T21:46:36Z")

</div>

Thank you for the response! Yes, but only if they are non-modal windows, in that case, they would be useful.

---

<div class="post-metadata">

**Author:** ![indranil](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/indranil/32/2584_2.png) [@indranil](https://forums.creativeclouddeveloper.com/u/indranil)\
**Post date:** [June 7, 2024, 5:00pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/14 "2024-06-07T17:00:58Z")

</div>

Unfortunately, the documentation of dialog options and overall dialogs is well…abysmal to be candid 😬. We are working on updating the dialog documentation, it shall take some time but it _shall be done_. Here’s how you can try out a dialog that resizes upon clicking a button in it.

```auto
<!DOCTYPE HTML>
<html>
<head>
    <script src="main.js"></script>
</head>
<body>
    <button id="show-dialog">Show dialog 3</button>
</body>
</body>
</html>

```

and in `main.js`:

```auto
document.getElementById("show-dialog").addEventListener("click", (e) => {
    const dialog = document.createElement("dialog");
    document.appendChild(dialog);
    const resizeButton = document.createElement("button");
    resizeButton.innerText = "Click to resize";
    resizeButton.addEventListener("click", (e) => {
        // random size on every click
        dialog.resizeTo(
            Math.floor(Math.random() * 50) + 500,
            Math.floor(Math.random() * 50) + 500
        );
    });
    dialog.appendChild(resizeButton);
    dialog.show({
        "size": {
            "width": 300,
            "height": 500
        }
    });
});

```

---

<div class="post-metadata">

**Author:** ![indranil](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/indranil/32/2584_2.png) [@indranil](https://forums.creativeclouddeveloper.com/u/indranil)\
**Post date:** [June 7, 2024, 5:01pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/15 "2024-06-07T17:01:59Z")

</div>

Yes, you can try my [above code snippet](http://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/14) for a non-modal dialog to see if it suits your use case.

---

<div class="post-metadata">

**Author:** ![PS-fxrios](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ps-fxrios/32/2461_2.png) [@PS-fxrios](https://forums.creativeclouddeveloper.com/u/PS-fxrios)\
**Post date:** [June 7, 2024, 7:32pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/16 "2024-06-07T19:32:14Z")

</div>

Tested and approved, this works perfectly! Luckily this feature is already available in the API, it was just hidden, this is essential in my projects. @indranil thanks for sharing, great support, and taking advantage of the fact that you have frequently visited this community, as soon as you can, visit this topic:[Object: printOneCopy does not work from the UXP plugin](http://forums.creativeclouddeveloper.com/t/object-printonecopy-does-not-work-from-the-uxp-plugin/7075) and inform us there about the implementation of this feature. Thanks.

---

<div class="post-metadata">

**Author:** ![svumme](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/svumme/32/1289_2.png) [@svumme](https://forums.creativeclouddeveloper.com/u/svumme)\
**Post date:** [June 7, 2024, 8:47pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/17 "2024-06-07T20:47:43Z")

</div>

That’s fantastic! Perfect for me, thank you so much!

---

<div class="post-metadata">

**Author:** ![indranil](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/indranil/32/2584_2.png) [@indranil](https://forums.creativeclouddeveloper.com/u/indranil)\
**Post date:** [June 18, 2024, 9:06am UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/18 "2024-06-18T09:06:43Z")

</div>

@PS-fxrios I did check the `print` related thread that you directed me to and that’s something that the Photoshop team would need to add in the PS DOM. Unfortunately, it’s not something that’s slated for this year.

---

<div class="post-metadata">

**Author:** ![PS-fxrios](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ps-fxrios/32/2461_2.png) [@PS-fxrios](https://forums.creativeclouddeveloper.com/u/PS-fxrios)\
**Post date:** [June 18, 2024, 11:49am UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-way-to-resize-plugin-window-via-js/5633/19 "2024-06-18T11:49:19Z")

</div>

@indranil thanks for responding to the complaint. I am improvising using atn actions for such print settings and run them via jsx in my UXP modal window.
