Edge groups
Edge groups are DockviewGroupPanel instances pinned to one of the four edges of the layout ('left', 'right', 'top', 'bottom'). They support tabs, drag-and-drop, overflow, and the full group panel API, and their state is included in toJSON / fromJSON.
Edge groups cannot be maximized or converted into floating/popout windows. They are structural elements of the layout.
The dndEdges prop controls the drag-and-drop overlay that appears when dragging panels to the far edges of the layout. See Drag and Drop for configuration details.
Adding edge groups
Call addEdgeGroup in your onReady handler (or any time after initialization):
// JavaScript
dockview.addEdgeGroup('left', {
id: 'left-group',
initialSize: 220,
minimumSize: 150,
});
dockview.addEdgeGroup('right', {
id: 'right-group',
initialSize: 220,
minimumSize: 150,
});
dockview.addEdgeGroup('bottom', {
id: 'bottom-group',
initialSize: 200,
minimumSize: 100,
});
// React
<DockviewReact
onReady={(event) => {
event.api.addEdgeGroup('left', {
id: 'left-group',
initialSize: 220,
minimumSize: 150,
});
event.api.addEdgeGroup('bottom', {
id: 'bottom-group',
initialSize: 200,
minimumSize: 100,
});
}}
components={components}
/>
Calling addEdgeGroup for a position that is already registered throws an error.
Edge group options
collapsed |
|
|---|---|
collapsedSize |
|
id |
|
initialSize |
|
maximumSize |
|
minimumSize |
|
autoHide | Opt this edge group in/out of auto-hide (pinnable tool-window) behaviour,
overriding the global autoHideEdgeGroups option. Requires the
auto-hide module to have any effect. Leave unset to inherit the global.
|
autoReveal | When true, this edge group tears itself down to zero footprint once
emptied (instead of collapsing to a strip). This is the behaviour used
by drag-revealed edges.
|
Adding panels into an edge group
Use addPanel with a position.referenceGroup pointing at the edge group's id:
const leftApi = api.addEdgeGroup('left', {
id: 'left-group',
initialSize: 220,
});
api.addPanel({
id: 'explorer',
component: 'Explorer',
title: 'Explorer',
position: { referenceGroup: leftApi.id },
});
API
addEdgeGroup | Add an edge group at the given position. Returns the group panel API
for the newly created group. Throws if a group already exists there.
|
|---|---|
getEdgeGroup | Get the group panel API for an edge group at the given position.
Returns undefined if no edge group is configured at that position.
|
isEdgeGroupVisible | Check whether an edge group is currently visible.
|
removeEdgeGroup | Remove an edge group and reclaim its slot in the layout.
All panels inside the group are disposed. Throws if no group exists at position.
|
revealEdgeGroupWithData | Reveal (create-or-fill) the edge group at position and move the dragged
item described by data into it. A newly created edge group tears down to
zero footprint when later emptied. Drives the dock-to-edge groups behind
the dockToEdgeGroups option; a no-op if edge groups are unavailable.
|
setEdgeGroupVisible | Set the visibility of an edge group.
|
Collapse and expand
Edge groups can be collapsed to their header strip and expanded back to their last size programmatically, or by the user clicking the active tab.
- Clicking the active tab toggles collapse/expand.
- Clicking a non-active tab switches to that tab, and expands the group if it was collapsed.
- Removing all panels from an edge group automatically collapses it.
onDidCollapsedChange | Fired when an edge group's collapsed state changes.
Never fires for non-edge groups.
|
|---|---|
collapse | Collapse this group (edge groups only). No-op for non-edge groups.
|
expand | Expand this group (edge groups only). No-op for non-edge groups.
|
isCollapsed | Returns true if this edge group is currently collapsed.
Always returns false for non-edge groups.
|
const groupApi = api.getEdgeGroup('left');
groupApi?.collapse();
groupApi?.expand();
const isCollapsed = groupApi?.isCollapsed(); // boolean
The collapsedSize (the pixel height/width of the header when collapsed) defaults to 35px and can be configured per-group via EdgeGroupOptions.collapsedSize, or per-theme via DockviewTheme.edgeGroupCollapsedSize.
Themes that set a custom edgeGroupCollapsedSize:
| Theme | edgeGroupCollapsedSize |
|---|---|
themeVisualStudio | 22 |
themeAbyssSpaced | 44 |
themeGithubLightSpaced | 44 |
| All other themes | 35 (default) |
When an edge group loses all of its panels it is automatically collapsed. Adding a new panel to it will expand it again.
Collapsed edge groups can auto-hide and peek back on demand. See Auto-hide Edge Groups.
Dock to edge groups
With the dockToEdgeGroups option an edge takes up zero space when empty and is revealed by dragging a panel to it, like a VS Code sidebar. See Dock to edge groups.
Auto-hide co-existence
Auto-hide (the pinnable tool-window behaviour) is opt-in per edge group, so a static always-docked edge group and an auto-hiding one can co-exist in the same layout. Pass autoHide to addEdgeGroup, or toggle it at runtime with api.setAutoHide; either overrides the per-edge autoHideEdgeGroups option for that group. api.isAutoHide() reads the resolved value back: the per-group override if one is set, otherwise the autoHideEdgeGroups option for that edge.
// this edge group auto-hides; others follow the per-edge option
api.addEdgeGroup('left', { id: 'left-group', autoHide: true });
// toggle at runtime
api.getEdgeGroup('right')?.setAutoHide(true);
// read the resolved state (per-group override, else the global option)
const autoHides = api.getEdgeGroup('right')?.isAutoHide(); // boolean
Turning auto-hide off on a group that is currently collapsed leaves a strip with no way to open it: the click-to-peek trigger goes away with auto-hide and the sash is locked at the collapsed size. Call expand() alongside setAutoHide(false) if the group might be collapsed.
Custom header actions
The location prop in rightHeaderActionsComponent, leftHeaderActionsComponent, and prefixHeaderActionsComponent updates reactively when a group moves. Use it to show controls specific to edge groups.
The DockviewGroupLocation type is a discriminated union:
type DockviewGroupLocation =
| { type: 'grid' }
| { type: 'floating' }
| { type: 'popout'; getWindow: () => Window }
| { type: 'edge'; position: EdgeGroupPosition }; // 'top' | 'bottom' | 'left' | 'right'
Check location.type to distinguish edge groups, and location.position to know which edge:
DockviewGroupLocation is exported from all framework packages.
See Group Controls for the full header actions reference.
Serialization
Edge group state (size, visibility, collapsed state, and panel contents) is included in toJSON / fromJSON automatically.
On fromJSON, edge groups are auto-created for any positions present in the serialized state that were not pre-registered via addEdgeGroup, so restoring a saved layout works without calling addEdgeGroup first:
const state = api.toJSON();
// state.edgeGroups = {
// left: { size: 220, visible: true, collapsed: false, group: { ... } },
// bottom: { size: 200, visible: false, collapsed: false, group: { ... } },
// }
api.fromJSON(state); // auto-creates and restores edge groups
See also
- Auto-hide edge groups: turn a collapsed edge group into a pinnable tool window
- Group controls: render controls specific to edge groups via the
locationprop