Resize plugin
This is helpful for when you need to minimize or expand the plugin for different user actions.
code.js
const height = '480';
const width = '320';
figma.ui.resize(width, height);
Check Figma API Docs for Figma UI - Resize (opens in a new tab)