n-uf motion
03 Docking layouts · Where panels and toolbars dock

Nine ways to lay out a workspace, and what gives way first.

This page lays out one workspace nine ways: a toolbar, five tool panels (Files, Outline, Notes, Inspector, History) and a few open documents. Four layouts (labeled A, A2, C and F3) are docked windows, laid out live by solve from @n-uf/docking. The other five are page sketches this page draws by its own rules, for comparison. Drag the sliders to see what gives way when width or height runs out; every box settles to its new place from wherever it is drawn.

Built with @n-uf/motion (opens in a new tab) createLayoutMotion (every box glides) · @n-uf/docking (opens in a new tab) solve (the four docked layouts; the page's other five layouts are sketches drawn by the page itself) · @n-uf/placement (opens in a new tab) masterStack, layoutSplit and splitFromOrder from /tiling (the tiles inside the documents' area)

Docking layoutsF3 · Docks + tear-off
Size
Quarterly planMeeting notesFilesOutlineNotesHistoryInspector (torn off)Toolbar
ToolbarBottom dock
Speed

Everything fits at its natural size.

Laid out live by solve from A's dock state with panels allowed to float (floatKinds): A's columns and bottom dock, and any panel can be torn off to float over the documents, then docked back on a column or a rail. Inspector starts torn off here. Docked is the default; floating is the exception you choose, and a float always stays in view.

toolbarpanelrail / tabsdocumentfloating panels over the documentsbottom dock

Looking for a ready React component? @n-uf/docking has no React binding and draws nothing; your app draws the panels. For tiled panes users drag beside each other and into tabs, see hypr-tiling's React dockable panels (opens in a new tab) guide (it has no floating windows).

The nine layouts

Docks, a tiling tree, scrolling columns, drawers and floating panels

A · Edge docksdocked

Laid out live by solve from a dock state with two side columns and a bottom dock. Each side has one column of stacked sections; each section is as tall as it wants, and the last one takes the rest. When height runs out, the least recently used section collapses to its header. When width runs out, the columns narrow, then the least recently used collapses to its rail. The bottom dock (outlined) sits between the columns and shortens the documents; on a short stage it shrinks, then collapses to a header bar.

A2 · Full-width bottom dockdocked

Laid out live by solve, from A's dock state with the dock's span set to "full". The same as A except for one thing: the bottom dock (outlined) runs the full width, and the columns and their rails stand on it. History gets the whole workspace's width, which suits a log or a timeline; the columns are shorter.

B · One tiling treesketch

A page sketch, drawn by this page's own rules, not by the library. Panels and documents are tiles of one tree, so a panel can sit beside a document. One rule for all: the newest tile that breaks a minimum floats.

C · Navigator + inspectordocked

Laid out live by solve from a dock state with two side columns and no dock. The left column shows one panel at a time under a row of tabs (the page draws the tabs in the column's top padding); the right column is a stack of sections. There is no bottom dock and nothing floats. When width runs out, the columns narrow, then collapse to their rails.

D · Scrolling columnssketch

A page sketch, drawn by this page's own rules, not by the library. Panels and documents are columns of a row wider than the screen; nothing shrinks below its minimum, and the view scrolls to the focus instead. Short on height, a column splits in two.

E · Drawerssketch

A page sketch, drawn by this page's own rules, not by the library. Documents take the screen; each side is a drawer with tabs. Wide, the drawers dock and push the documents aside. Narrow, they overlay the documents.

F1 · Floating panels oversketch

A page sketch, drawn by this page's own rules, not by the library. Documents take the whole workspace; panels are floating panels over them at their natural size, anchored to the top corners and draggable anywhere. The toolbar floats too (top or bottom). Short on height, the least recently used collapse to their headers; the documents never move.

F2 · Floating panels, documents aroundsketch

A page sketch, drawn by this page's own rules, not by the library. Floating panels sit at their natural size, but they keep their footprint free: the documents tile in the space between them. Nothing is covered, and the space under a short stack stays empty.

F3 · Docks + tear-offour pick

Laid out live by solve from A's dock state with panels allowed to float (floatKinds): A's columns and bottom dock, and any panel can be torn off to float over the documents, then docked back on a column or a rail. Inspector starts torn off here. Docked is the default; floating is the exception you choose, and a float always stays in view.

How they compare

Nine questions, nine layouts

LayoutLaid out byToolbarPanels on one sideWhen height runs outWhen width runs outCovers documentsReflows on its ownDrop targets while draggingKnown from
A · Edge docksa dock state, laid out by solvetoolbar, top or bottom; space reserved for it, or floating over the documentsstacked sections at their natural heights; a bottom dock between the columnsthe least recently used section collapses to its header; the bottom dock shrinks, then collapses to a header barcolumns narrow, then the least recently used collapses to its railnever, unless you lay the bottom dock over themrarely: sections, columns and the bottom dock collapsea new column, into a column, a rail, the bottom dockIDE tool windows (VS Code's bottom panel, alignment "center")
A2 · Full-width bottom docka dock state, laid out by solveas Aas A; the bottom dock runs under the columnsas A; the columns are shorteras A; the bottom dock keeps the full widthas Ararelyas AIDE tool windows (VS Code's bottom panel, alignment "justify")
B · One tiling treea page sketchbar across the toptiles in the same tree as documentsnewest tile floatsnewest tile floatsonly floated tilesoften: opening a document reshapes panelsany tile edgetiling window managers
C · Navigator + inspectora dock state, laid out by solvetoolbar, top or bottom; space reserved for it, or floating over the documentsleft: tabs, one panel shows; right: stacked sectionssections on the right collapse to headers; the tabs never changecolumns narrow, then collapse to their railsneverrarely: columns collapsea new column, into a column (a tab on the left), a raildesign tools
D · Scrolling columnsa page sketchbar across the topstacked in the columns of a scrolling rowa column splits in twothe row scrollsneverthe view scrolls to the focusbetween columns, inside a columnscrollable tiling window managers
E · Drawersa page sketchbar across the toptabs: one panel per drawernothing happensdrawers overlay the documents instead of pushingnarrow onlydrawers switch at a widthleft / right tab rowstablet apps
F1 · Floating panels overa page sketchfloating toolbar, top or bottom; reserved space or overlayfloating panels stacked in a corner, or anywherethe least recently used floating panels collapse to headersfloating panels cover more; narrow, stacks merge in one corneralways (shown under the stage)neveranywhere (snap to corners, edges, other panels)creative tools' floating panels
F2 · Floating panels, documents arounda page sketchfloating toolbar, top or bottom; reserved space or overlayfloating panels stacked in a corner, or anywherethe least recently used floating panels collapse to headersdocuments get narrowernever; leaves empty space under short stacksdocuments re-tile when a panel movesanywhere (snap to corners, edges)window managers' "struts"
F3 · Docks + tear-offa dock state, laid out by solvetoolbar, top or bottom; space reserved for it, or floating over the documentsas A; any panel can floatas A; a float stays in viewas Awhat floats (Inspector starts torn off), or the bottom dock if you lay it over themrarelyas A, or anywhere to floatIDE tool windows (floating mode)
Our pick

F3 · Docks + tear-off

A, A2, C and F3 are each a DockState from @n-uf/docking: a column edge on each side, a bottom dock edge, the panels as items with their forms, and any floats. solve lays one out. The letters are this page's labels. Our pick is F3, A's dock state with floatKinds set so panels may float, and one rule: a panel lives in a column, and a column collapses to its rail. Short on height, sections collapse to their headers and the bottom dock shrinks, then collapses to a header bar. Short on width, columns narrow, then collapse to their rails (contentMin). Nothing covers the documents unless you choose it: tear a panel off and it floats, and drop it on a column or a rail to dock it back. Space for the toolbar is a bar edge holding a fixed item, and the app draws the toolbar there. Every glide is a column, a section or a float opening, closing or moving, which settle already does.

A is the same without floating; C is the simplest if one panel at a time on the left is enough.

FAQ

Questions

How do I drag a panel from one dock to another?

Take drop targets from targets(state, id) in @n-uf/docking and feed them to createDragIntent from @n-uf/motion/drag, or take lanes(state, id) for createLandingModel. Each DockDrop carries what a release there makes: target.after(point, grab) returns the new dock state and its layout, so the preview is the result. Your app draws the rects.

Which docking layouts can I build?

Any you can describe as a DockState from @n-uf/docking: edges along the window's sides (columns, docks, toolbars), the panels in them, and floats. This page lays out four: side docks with a bottom dock, the same with a full-width dock, the same with floating panels, and a navigator. Panes that share an area come from ./tiling in @n-uf/placement.

What gives way when a docked window runs out of room?

The least recently used section collapses to its header when a column runs short of height. Short of width (contentMin), columns narrow, then the least recently used collapses to its rail. A dock with giveWay shrinks, then collapses to a header bar. solve returns coded notes such as column-folded; your app supplies the wording.

Can I use these docking layouts in React?

Yes, with your own rendering. @n-uf/docking has no React components and draws nothing: you keep a DockState in your state, draw the rects solve returns, and feed pointer samples to a drag. For a ready-made React component with tabs and splits but no floating windows, n-uf has a separate library, linked in the note under the demo.