Figma Support Forum

Center align plugin container

How can I center align the plugin container, based on screen size?

There is no way to move it, unfortunately. Only the user can control where the plugin window is placed.

1 Like

Thanks :+1:

You can vote for a similar idea here: Handle plugin location from figma.ui

With the recent update to the Plugin API, this is now possible.

Code.js example:

let pluginWidth = 800,
	pluginHeight = 480,
	centerX = Math.round( - (pluginWidth / 2)),
	centerY = Math.round( - (pluginHeight / 2));

		title: 'Plugin Name',
		width: pluginWidth,
		height: pluginHeight,
		position: {
			x: centerX,
			y: centerY
1 Like