Skip to main content

Resizing

This section describes how to programatically resize a panel.

height
The panel height in pixels
readonly height: number
onDidDimensionsChange
readonly onDidDimensionsChange: Event<PanelDimensionChangeEvent>
width
The panel width in pixels
readonly width: number
setSize
setSize(event: SizeEvent): void

Panel Resizing

Each dock contains groups and each group contains panels. Logically a user may want to resize a panel but this really translates to resizing the group which contains that panel.

The panel resize methods are repeats of the same resize methods found on the group.

// it's mandatory to provide either a height or a width, providing both is optional
props.api.setSize({
height: 100,
width: 200,
});

/**
* you could also resize the panels group, although not recommended due to the
* clunky syntax it does achieve the same result
*/
props.api.group.api.setSize({
height: 100,
width: 200,
});

You can see an example invoking both approaches below.