Skip to main content

Remove Panel

This section describes multiple ways to remove a panel.

Remove a Panel using the Panel API

close
close(): void

Calling close on the panel API is the easiest way to close a panel through code.

panel.api.close();

Remove a Panel using the API

removePanel
Remove a panel given the panel object.
removePanel(panel: IDockviewPanel): void

Firstly, you can retrieve a reference to the panel given it's id and then you can pass that reference into removePanel to remove the panel.

const panel: IDockviewPanel = api.getPanel('myPanel');
api.removePanel(panel);