Layout

Dock manager

@xui/dock-manager

An IDE-style docking layout driven by one serialisable tree: resizable split panes, tab groups, a document host for editor tabs, panes that collapse to the edges, and floating windows. Drag a pane header or tab and Visual Studio's docking targets appear: a five-way joystick over the pane under the pointer — arms to split it, centre to tab with it — plus an outer ring at the edges for docking against the whole layout. The target that would be used lights up and an outline previews the space it would take. Drop outside the layout to float the pane. Every action is also on the header: pin, float, maximize, close. Splitter gutters take arrow keys, and tab strips take arrow/Home/End. A pane's body is declared once as <ng-template xuiDockContent="id"> and then *moved* rather than rebuilt, so scroll position and half-typed input survive a drag.

Install

pnpm add @xui/dock-manager

Add the barrel to a standalone component's imports:

import { XuiDockManagerImports } from '@xui/dock-manager';

@Component({
  imports: [XuiDockManagerImports],
  // …
})

Examples

Default

Loading preview…

Ide

Loading preview…

Preserves content

Loading preview…

Restricted panes

Loading preview…

Right to left

Loading preview…

API

XuiDockContent

directiveng-template[xuiDockContent]

Declares the body of one content pane.

Inputs

NameTypeDefaultcontentIdrequiredstringMatches the contentId of a content pane in the layout.

XuiDockContentOutlet

directive[xuiDockContentOutlet]

Fills its host element with the content view for a contentId.

Inputs

NameTypeDefaultcontentIdrequiredstringWhich pane's content view to mount here — the contentId of the matching xuiDockContent.

XuiDockManager

componentxui-dock-manager

An IDE-style docking layout: resizable split panes, tab groups, a document host, collapsible edge panels and floating windows, all driven by one serialisable {@link XuiDockManagerLayout} tree.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''layoutrequiredtwo-wayXuiDockManagerLayoutThe layout tree. Two-way bindable, and edited **in place** — see the class docs for why, and use cloneDockLayout() for snapshots.

Outputs

NameTypepaneCloseXuiDockContentPaneA pane was closed and removed from the layout.activePaneChangeXuiDockContentPane | nullThe pane the user last interacted with, or null once it is gone.panePinnedChangeXuiDockPaneStateEventEmits the pane and its new pinned state whenever a pane is pinned or unpinned.paneMaximizedChangeXuiDockPaneStateEventEmits the pane and its new maximized state whenever a pane is maximized or restored.paneFloatingChangeXuiDockPaneStateEventEmits the pane and its new floating state whenever a pane is torn out of the layout or docked back into it.paneDragStartXuiDockPaneA pointer drag on a pane header or tab began.paneDragEndXuiDockPaneA pointer drag ended, whether or not it changed the layout.

Methods

mountContent(contentId: string, host: HTMLElement): voidreleaseContent(contentId: string, host: HTMLElement): voidclosePane(pane: XuiDockContentPane): voidRemove pane from the layout. Respects allowClose.closeWindow(window: XuiDockSplitPane): voidClose every pane in a floating window.unpinPane(pane: XuiDockContentPane): voidCollapse pane to a tab on the nearest edge, keeping its place in the tree.pinPane(pane: XuiDockContentPane): voidRestore pane to the position it was collapsed from.togglePinned(pane: XuiDockContentPane): voidmaximizePane(pane: XuiDockContentPane): voidBlow pane up to fill the whole dock manager, hiding everything else.restorePane(pane: XuiDockContentPane): voidtoggleMaximized(pane: XuiDockContentPane): voidfloatPane(pane: XuiDockPane, location?: XuiDockPoint, size?: { width: number; height: number }): voidMove pane into a floating window of its own.dockPane(pane: XuiDockPane, target: XuiDockPane, position: XuiDockPosition): booleanDock pane at position relative to target.selectPane(pane: XuiDockContentPane): voidMake pane the active one, selecting its tab and opening its fly-out.

Source

libs/ui/dock-manager/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.