I would like to make a Google Sheets add-on. Most of the existing Google Sheets add-ons open a sidebar on the right of Google Sheets. But the sidebar is very narrow (i.e., 300px), we cannot change its width, it's not convenient at all.
So I'm thinking how to propose a bigger panel to host my add-on. I have seen and tried this add-on. It opens a dialog-like window above the content of the sheets, the size is changeable.
On the other hide, I tried the following code in Apps Script. It does open a dialog but the size cannot be changed by mouse.
function onOpen() {
var ui = SpreadsheetApp.getUi();
// Or DocumentApp or FormApp.
ui.createMenu('My Custom Menu')
.addItem('Show Dialog', 'showDialog')
.addToUi();
}
function showDialog() {
// Create HTML output object
var htmlOutput = HtmlService.createHtmlOutput('<p>Hello, World!</p>')
.setWidth(400) // Set width
.setHeight(300); // Set height
// Display modal dialog with the title 'My Dialog'
SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'My Dialog');
}
Does anyone know how to make a floating panel like the example add-on whose size can be changed by mouse?
Edit 1: I realize that we can change the position for both model dialog and modeless dialog, we just need to drag the right position (where the title is).

From @Mogsdad's answer:
On the other hand, It is not possible to use the mouse to directly resize or reposition a
modal dialogbox that has been launched in Google Sheets when using Apps Script.you can use the
setWidth,setHeightmethods in Apps Script to set the dialog box's initial size programmatically (as what you have used in your example code).For more information about the
ModalDialog box:Class UiAside from the links I shared in the comment section, Here are additional references: