Skip to main content

Group API

The group API controls a single group of panels: its active panel, location, and header.

Use the group API sparingly. As you move panels, groups change and if you don't track this correctly you may encounter unexpected behaviours. You should be able to achieve most things directly through the panel API.

component
The id of the component renderer
readonly component: string
height
The panel height in pixels
readonly height: number
id
The id of the panel that would have been assigned when the panel was created
readonly id: string
isActive
Whether the panel is the actively selected panel
readonly isActive: boolean
isFocused
Whether the panel holds the current focus
readonly isFocused: boolean
isVisible
Whether the panel is visible
readonly isVisible: boolean
onDidActiveChange
readonly onDidActiveChange: Event<ActiveEvent>
onDidDimensionsChange
readonly onDidDimensionsChange: Event<PanelDimensionChangeEvent>
onDidFocusChange
readonly onDidFocusChange: Event<FocusEvent>
onDidParametersChange
readonly onDidParametersChange: Event<Parameters>
onDidVisibilityChange
readonly onDidVisibilityChange: Event<VisibilityEvent>
onWillFocus
readonly onWillFocus: Event<WillFocusEvent>
width
The panel width in pixels
readonly width: number
getParameters
getParameters(): T
setActive
setActive(): void
setVisible
setVisible(isVisible: boolean): void
updateParameters
updateParameters(parameters: Parameters): void
onDidConstraintsChange
readonly onDidConstraintsChange: Event<GridConstraintChangeEvent>
setConstraints
setConstraints(value: GridConstraintChangeEvent2): void
setSize
setSize(event: SizeEvent): void
location
readonly location: DockviewGroupLocation
locked
Whether this group is locked against drop interactions. - true: panels cannot be dropped into the group (center / tabs), but the group can still be split from its edges. - 'no-drop-target': all drop zones are disabled for this group.
locked: DockviewGroupPanelLocked
onDidActivePanelChange
Fires when the active panel *within this group* changes. Scoped to the group, in contrast to the component-level DockviewApi.onDidActivePanelChange (which tracks the active panel across the whole dockview). Both carry an DockviewOrigin reporting whether the change came from a user gesture or an API call.
readonly onDidActivePanelChange: Event<DockviewGroupActivePanelChangeEvent>
onDidCollapsedChange
Fired when an edge group's collapsed state changes. Never fires for non-edge groups.
readonly onDidCollapsedChange: Event<DockviewGroupPanelCollapsedChangeEvent>
onDidHeaderDirectionChange
Fires when this group's header flips orientation between horizontal (top/bottom) and vertical (left/right), e.g. when headerPosition moves from top to left. Does not fire for position changes that keep the same axis (top↔bottom, left↔right) or for the initial set.
readonly onDidHeaderDirectionChange: Event<DockviewGroupPanelHeaderDirectionChangeEvent>
onDidLocationChange
readonly onDidLocationChange: Event<DockviewGroupPanelLocationChangeEvent>
onDidPeekChange
Fired when an edge group's auto-hide *peek* state changes (the slid-out overlay shown/hidden while the group stays logically collapsed). Never fires for non-edge groups or without the auto-hide module.
readonly onDidPeekChange: Event<DockviewGroupPanelPeekChangeEvent>
close
close(): void
collapse
Collapse this group (edge groups only). No-op for non-edge groups.
collapse(): void
exitMaximized
exitMaximized(): void
expand
Expand this group (edge groups only). No-op for non-edge groups.
expand(): void
getHeaderPosition
getHeaderPosition(): DockviewHeaderPosition
getWindow
If you require the Window object
getWindow(): Window
isAutoHide
The resolved auto-hide state of this edge group: the per-group override if one is set, otherwise the global autoHideEdgeGroups option for this edge. Always returns false for non-edge groups.
isAutoHide(): boolean
isCollapsed
Returns true if this edge group is currently collapsed. Always returns false for non-edge groups.
isCollapsed(): boolean
isMaximized
isMaximized(): boolean
isPeeking
True while this edge group is peeking (auto-hide slid-out overlay).
isPeeking(): boolean
maximize
maximize(): void
moveTo
moveTo(options: DockviewGroupMoveParams): void
setAutoHide
Opt this edge group in/out of auto-hide (pinnable tool-window) behaviour at runtime, overriding the global autoHideEdgeGroups option. Pass undefined to clear the override and inherit the global. No-op for non-edge groups or without the auto-hide module.
setAutoHide(value: undefined | boolean): void
setHeaderPosition
setHeaderPosition(position: DockviewHeaderPosition): void

See also