# Programmatically hide panel

**URL:** <https://forums.creativeclouddeveloper.com/t/programmatically-hide-panel/5970>\
**Category:** UXP Plugin API\
**Tags:** ui, panel, uxp\
**Created:** [March 3, 2023, 3:04pm UTC](https://forums.creativeclouddeveloper.com/t/programmatically-hide-panel/5970 "2023-03-03T15:04:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbrowning](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@rbrowning](https://forums.creativeclouddeveloper.com/u/rbrowning)\
**Post date:** [March 3, 2023, 3:04pm UTC](https://forums.creativeclouddeveloper.com/t/programmatically-hide-panel/5970/1 "2023-03-03T15:04:28Z")

</div>

Hello

I’d like a way to close my panel on the click of a cancel button. Something along the lines of:

this.close().

Is there a way to do so?

---

<div class="post-metadata">

**Author:** ![Maher](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/maher/32/1432_2.png) [@Maher](https://forums.creativeclouddeveloper.com/u/Maher)\
**Post date:** [March 3, 2023, 4:10pm UTC](https://forums.creativeclouddeveloper.com/t/programmatically-hide-panel/5970/2 "2023-03-03T16:10:43Z")

</div>

please use search before posting to see relevant discussions.

TL;DR : No, not at this moment.

> There is no mechanism in UXP to _close_ a plugin’s panel. (You can show panels in PS prerelease, but not hide them programmatically).
> 
> Instead of hiding, render some UI to the user that explains what the issue is, and what they can do to rectify the issue. Otherwise the user may wonder why the plugin isn’t working as expected – which can lead to increased support requirements.

[source and discussion here.](http://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819)

---

<div class="post-metadata">

**Author:** ![rbrowning](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@rbrowning](https://forums.creativeclouddeveloper.com/u/rbrowning)\
**Post date:** [March 6, 2023, 10:13am UTC](https://forums.creativeclouddeveloper.com/t/programmatically-hide-panel/5970/3 "2023-03-06T10:13:37Z")

</div>

Dear Maher,

Thank you for your reply. I searched and found your suggested workaround. However, this won’t be suitable for my needs.

I’m wondering if I need to go down the route of a single panel with changing content. However, the issue with this is then that I have a panel fixed at one size which looks incorrect for some UI ‘screens’.

All my panels are shown on loading the plugin as well - any ideas if there is a default flag to not be opened?

---

<div class="post-metadata">

**Author:** ![Maher](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/maher/32/1432_2.png) [@Maher](https://forums.creativeclouddeveloper.com/u/Maher)\
**Post date:** [March 6, 2023, 10:58am UTC](https://forums.creativeclouddeveloper.com/t/programmatically-hide-panel/5970/4 "2023-03-06T10:58:50Z")

</div>

does [this](https://developer.adobe.com/photoshop/uxp/2022/guides/uxp_guide/uxp-misc/manifest-v4/photoshop-manifest/#loadevent) help?

> The loadEvent field allows a plugin to specify when it is loaded. The possible values are:
> 
> - `use`: The plugin is loaded when needed (when its UI become visible, or when a plugin command is executed). This is the default value.
> - `startup`: The plugin is loaded automatically shortly after Photoshop is launched.

---

<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:** [March 6, 2023, 11:01am UTC](https://forums.creativeclouddeveloper.com/t/programmatically-hide-panel/5970/5 "2023-03-06T11:01:03Z")

</div>

Sadly `loadEvent` does not define if panels are opened or not. They are always opened on plugin load. But once plugin is loaded, next time panels will remain in the last used state

---

<div class="post-metadata">

**Author:** ![Maher](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/maher/32/1432_2.png) [@Maher](https://forums.creativeclouddeveloper.com/u/Maher)\
**Post date:** [March 6, 2023, 11:05am UTC](https://forums.creativeclouddeveloper.com/t/programmatically-hide-panel/5970/6 "2023-03-06T11:05:08Z")

</div>

I haven’t tried but I wonder if entrypoint setup can help creating panels conditionally.

but seems too much work tbh

---

<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:** [March 6, 2023, 11:14am UTC](https://forums.creativeclouddeveloper.com/t/programmatically-hide-panel/5970/7 "2023-03-06T11:14:56Z")

</div>

> [@Maher](#):
>
> I wonder if entrypoint setup can help creating panels conditionally

AFAIK, no. One of my plugins would get a huge benefit if I could just create or remove panels on the go 🙂
