Skip to main content

Resizing

height
The panel height in pixels
readonly height: number
onDidDimensionsChange
readonly onDidDimensionsChange: Event<PanelDimensionChangeEvent>
width
The panel width in pixels
readonly width: number
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
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 Dockview contains of a number of groups and each group has a number of panels. Logically a user may want to resize a panel, but this translates to resizing the group which contains that panel.

You can set the size of a panel using props.api.setSize(...). You can also set the size of the group associated with the panel using props.api.group.api.setSize(...) although this isn't recommended due to the clunky syntax.

// 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 it achieved the same result
props.api.group.api.setSize({
height: 100,
width: 200,
});

You can see an example invoking both approaches below.