Skip to main content
SLT-UX
Active Member
Feb 6, 2023 8:56 PM UTC
Question

Plugin window questions (docking and window size)

This is a question for plugin developers…

Is there a min/max width and height for the dimensions of a plugin window? For example is it possible to make the plugin window very narrow (like 40 pixels for example), and make its height fill the height of the Figma application viewport?

Also, is it possible to “dock” the plugin window to either side (right, left, top, or bottom) of the Figma UI, so that it’s basically attached to one of these sides.

This topic has been closed for replies.

10 replies

tank666
Feb 6, 2023 9:49 PM UTC

width: The width of the UI. Defaults to 300. Minimum is 70. Can be changed later using Figma.ui.resize(width, height)

height: The height of the UI. Defaults to 200. Minimum is 0. Can be changed later using Figma.ui.resize(width, height)
showUI | Plugin API

Yes you can. Just provide the required parameters in the above method.

You can specify the plugin’s modal window position in the above method, but not dock because Figma doesn’t natively have this feature.

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
SLT-UX
SLT-UXAuthor
Active Member
Feb 6, 2023 10:24 PM UTC

Thanks for the quick response!

Re: specifying the plugin’s modal window position, can it be specified in a relative manner, or only in an absolute manner. In other words:

  1. Relative: 250px from the the right side of the Figma application viewport, and 25px from the top of the Figma application viewport.

  2. Absolute: 500px to the right, and 25px down, from the top left corner of the application viewport.

Also, can a plugin poll the current Figma application viewport’s dimensions? And if so, reposition itself accordingly?

tank666
Feb 6, 2023 10:42 PM UTC
UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
SLT-UX
SLT-UXAuthor
Active Member
Feb 6, 2023 11:02 PM UTC

Got it.

Well, it depends on what the plugin does 🙂 I have an idea for a plugin but in order for it to work well and have a good UX, it needs to behave more like a toolbar. That’s why I was asking about it being very narrow, and “docked” to a side of the Figma viewport.

But this is promising. I think the only limitation might be that only one plugin can run at a time. Hopefully Figma can take away that limitation, and allow maybe a few plugins to run at the same time (at least two lol).

Alex_FG
New Participant
Feb 12, 2023 9:22 PM UTC

Docking will be “possible” if you do it manually like you described. All we’re waiting for is for figma.ui.reposition() to officially become available and we’re good. (This will also allow for left edge window resizing.)

I’ve actually had everything prepared for docking in my plugin’s current dev version for a while, just waiting for this function. 😛

The next step is to let us remove the plugin window’s shadow and give it a panel-like border, so that it looks like a docked panel. 😛

SLT-UX
SLT-UXAuthor
Active Member
Feb 14, 2023 12:14 AM UTC

Cool, good to see other folks wishing for a bit more versatility in how a plugin integrates with the rest of the Figma UI. Is your plugin out yet (the undocking version)? What does it do?

Alex_FG
New Participant
Feb 15, 2023 2:00 PM UTC

Hey, it’s this one: Generator | Figma Community. Lets you work with colors using a node graph.

parrot
New Participant
Jul 24, 2023 10:07 AM UTC

I found a way to dock a plugin using the reposition api. See it in use in my Plugin for Translation managment - Parrot.
Sadly there is a bug in the reposition function in Figma and there is no easy and robust way to get the xy position of the plugin atm - see Retrieve plugin UI position? and Get relative position of plugin UI window to main Figma window
So the solution i come up with involves a lot of little tricks. I am currently cleaning up the code and plan to publish it as a little library soon.

Jason_Burns
New Member
Oct 23, 2024 2:38 AM UTC

@parrot Did you ever end up sharing your code for docking anywhere? Curious to see how it works.

parrot
New Participant
Jan 14, 2025 2:05 PM UTC

Hey ​@Jason_Burns was busy with other stuff recently…
In the very end of the loom attached you see some details on how it works - pretty nasty hack so ;-).

Some good news: We gonna move the sources to the public repo of https://github.com/opral/monorepo pretty soon - i will keep you in the loop